- What is awcodes/recently used for in Laravel?
- It adds a Recently Viewed menu to Filament panels and tracks when users visit or edit resource records. It is designed for Filament admin panels rather than general Laravel apps. You enable tracking by adding a trait to EditRecord or ViewRecord pages.
- How do I install awcodes/recently in a Laravel Filament app?
- Run composer require awcodes/recently, then php artisan recently:install and follow the prompts. You also need a custom Filament theme and must add the package views to your theme CSS with the @source directive. Register RecentlyPlugin::make() in your panel's plugins array.
- Which Filament versions does awcodes/recently support?
- Package 3.x supports Filament 4.x and 5.x, package 2.x supports Filament 5.x, and package 1.x supports Filament 3.x. Check the compatibility table before installing. Filament 2.x is not supported and would require backporting.
- How do I enable recently viewed tracking on a Filament resource?
- Add the package trait to the resource's EditRecord or ViewRecord page. Tracking only applies to pages where the trait is included. The plugin then records views and visits for those resource pages.
- Why is my Recently Viewed menu empty after installing awcodes/recently?
- Make sure the plugin is registered in the panel and the tracking trait is added to at least one EditRecord or ViewRecord page. Confirm the migrations have run and that users have visited a tracked resource page. If you use a custom theme, verify the package views are included in your CSS build.
- What database table does awcodes/recently use?
- Current docs reference a recent_entries table, while earlier builds or migrations may refer to a recently_viewed table. Confirm the actual table name against the installed migration before writing queries or indexes. v3.2.0 adds a second migration required only for the track_records option.
- How do I limit or prune old recently viewed records?
- v3.2.0 supports max_stored_items and prune_after_days configuration to bound retention. The package hooks into Laravel's model:prune lifecycle, so ensure the scheduler is running for pruning to occur. These options are opt-in and default to existing behavior.
- Does awcodes/recently support soft-deleted records?
- With track_records enabled, deleted records are hidden by default. You can set include_trashed_records to true to opt soft-deleted records back into the menu. Hard-deleted records cannot be restored by this flag.
- What conflicts should I check when using awcodes/recently?
- If you use QuickCreatePlugin or OverlookPlugin, exclude RecentEntryResource from them. The README shows excludes([RecentEntryResource::class]) for both plugins. This prevents those plugins from acting on the package's internal resource.
- Is awcodes/recently safe for production and large datasets?
- It adds database writes on tracked resource views, mitigated by caching in config/recently.php. Recent records are fetched with orderBy and limit, so validate performance on large datasets using DB::enableQueryLog. Use max_stored_items and prune_after_days with a scheduled model:prune to control table growth.