### Install the Recently Plugin Source: https://github.com/awcodes/recently/blob/main/README.md Install the awcodes/recently plugin using Composer and run the artisan command to publish assets and complete the installation process. ```bash composer require awcodes/recently ``` ```bash php artisan recently:install ``` -------------------------------- ### Running RecentlyPlugin Tests (Bash) Source: https://github.com/awcodes/recently/blob/main/README.md To execute the test suite for the awcodes/recently plugin, use the standard composer command for running tests. ```bash composer test ``` -------------------------------- ### Configuring Composer for Local RecentlyPlugin Development (JSON) Source: https://github.com/awcodes/recently/blob/main/README.md To contribute to the plugin or test changes locally, configure your Filament project's `composer.json` to use a local path repository pointing to your cloned fork of the plugin. This allows Composer to load the plugin directly from your local filesystem. ```json "require": { "awcodes/recently": "dev-fix/error-message as main-dev" }, "repositories": [ { "type": "path", "url": "recently" } ] ``` -------------------------------- ### Default Recently Plugin Configuration Source: https://github.com/awcodes/recently/blob/main/README.md View the default settings available in the recently.php configuration file, allowing global customization of user model, max items, width, global search, menu visibility, and icon. ```php // config/recently.php return [ 'user_model' => App\Models\User::class, 'max_items' => 20, 'width' => 'xs', 'global_search' => true, 'menu' => true, 'icon' => 'heroicon-o-arrow-uturn-left', ]; ``` -------------------------------- ### Register the Recently Plugin in a Filament Panel Source: https://github.com/awcodes/recently/blob/main/README.md Register the RecentlyPlugin instance within the plugins array of your Filament panel definition to enable its functionality. ```php use Awcodes\Recently\RecentlyPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ RecentlyPlugin::make(), ]); } ``` -------------------------------- ### Setting RecentlyPlugin Menu Label (PHP) Source: https://github.com/awcodes/recently/blob/main/README.md The menu has no label by default. You can set a custom label for the menu by passing a string to the `label()` method during plugin configuration. ```php use Awcodes\Recently\RecentlyPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ RecentlyPlugin::make() ->label('Recently Viewed Records'), ]); } ``` -------------------------------- ### Add Plugin Views to Tailwind Config Source: https://github.com/awcodes/recently/blob/main/README.md Include the plugin's Blade views in your Tailwind CSS configuration file to ensure styles are correctly processed, aligning with Filament's theming methodology. ```js content: [ './vendor/awcodes/recently/resources/**/*.blade.php', ] ``` -------------------------------- ### Setting RecentlyPlugin Menu Width (PHP) Source: https://github.com/awcodes/recently/blob/main/README.md The dropdown menu utilizes Filament's dropdown blade component. You can set the width of the dropdown menu by passing a valid width option (like 'sm', 'md', 'lg', etc.) to the `width()` method. The default width is 'xs'. ```php use Awcodes\Recently\RecentlyPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ RecentlyPlugin::make() ->width('sm'), ]); } ``` -------------------------------- ### Exclude RecentEntryResource from Other Plugins Source: https://github.com/awcodes/recently/blob/main/README.md Prevent potential conflicts by excluding the internal RecentEntryResource from other plugins like QuickCreatePlugin or OverlookPlugin if you are using them. ```php OverlookPlugin::make() ->excludes([ RecentEntryResource::class, ]), ``` ```php QuickCreatePlugin::make() ->excludes([ RecentEntryResource::class, ]), ``` -------------------------------- ### Changing RecentlyPlugin Render Hook (PHP) Source: https://github.com/awcodes/recently/blob/main/README.md By default, the plugin renders the menu using the `PanelsRenderHook::USER_MENU_BEFORE` hook. You can change where the menu is rendered within the Filament panel by providing a different valid Filament Render Hook constant to the `renderUsingHook()` method. ```php use Awcodes\Recently\RecentlyPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ RecentlyPlugin::make() ->renderUsingHook('PanelsRenderHook::USER_MENU_AFTER'), ]); } ``` -------------------------------- ### Track Recent History on Resource Pages Source: https://github.com/awcodes/recently/blob/main/README.md Include the HasRecentHistoryRecorder trait on your resource's EditRecord or ViewRecord pages to automatically track user visits and edits for those records. ```php use Awcodes\Recently\Concerns\HasRecentHistoryRecorder; class EditUser extends EditRecord { use HasRecentHistoryRecorder; protected static string $resource = UserResource::class; } ``` ```php class ViewUser extends ViewRecord { use HasRecentHistoryRecorder; protected static string $resource = UserResource::class; } ``` -------------------------------- ### Limiting RecentlyPlugin Max Items (PHP) Source: https://github.com/awcodes/recently/blob/main/README.md You can control the maximum number of recently viewed items displayed in the menu dropdown. Specify the desired limit by passing an integer value to the `maxItems()` method. ```php use Awcodes\Recently\RecentlyPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ RecentlyPlugin::make() ->maxItems(10), ]); } ``` -------------------------------- ### Set Custom Icon via Panel Method Source: https://github.com/awcodes/recently/blob/main/README.md Customize the icon displayed for the 'Recently Viewed' menu in the topbar specifically for a particular panel, overriding the global configuration. ```php use Awcodes\Recently\RecentlyPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ RecentlyPlugin::make() ->icon('heroicon-o-clock'), ]); } ``` -------------------------------- ### Disable Menu via Panel Method Source: https://github.com/awcodes/recently/blob/main/README.md Override the global configuration and disable the 'Recently Viewed' dropdown menu in the topbar specifically for a particular panel. ```php use Awcodes\Recently\RecentlyPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ RecentlyPlugin::make() ->menu(condition: false), ]); } ``` -------------------------------- ### Configuring RecentlyPlugin Rounded Icon (PHP) Source: https://github.com/awcodes/recently/blob/main/README.md By default, the menu icon is round. You can disable this rounded appearance by passing `false` to the `rounded()` method when configuring the plugin. ```php use Awcodes\Recently\RecentlyPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ RecentlyPlugin::make() ->rounded(condition: false), ]); } ``` -------------------------------- ### Disable Global Search via Panel Method Source: https://github.com/awcodes/recently/blob/main/README.md Override the global configuration and disable the integration of recently viewed items into the global search results specifically for a particular panel. ```php use Awcodes\Recently\RecentlyPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ RecentlyPlugin::make() ->globalSearch(condition: false), ]); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.