PHP code example of wezlo / filament-search-spotlight
1. Go to this page and download the library: Download wezlo/filament-search-spotlight library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wezlo / filament-search-spotlight example snippets
use Wezlo\FilamentSearchSpotlight\FilamentSearchSpotlightPlugin;
->plugins([
FilamentSearchSpotlightPlugin::make(),
])
FilamentSearchSpotlightPlugin::make()
// Keyboard binding (Mousetrap syntax). Accepts a string or an array.
->keyBinding('mod+k')
// Placeholder text for the search input.
->placeholder('Jump to…')
// Any valid CSS width (rem, px, vw, %, …). Applied as an inline style so
// it is not subject to Tailwind purging.
->maxWidth('36rem')
// Max results per category.
->resultLimitPerCategory(8)
// Toggle built-in categories (all default on).
->records() // records(false) to hide
->resources()
->pages()
->actionsEnabled()
// Or completely override the category list with your own.
->categories([MyCustomCategory::class])
// Exclude resources from both the Records and Resources categories
// (also prevents their auto-generated Create action).
->excludeResources([AuditLogResource::class])
// Register actions scoped to this panel (on top of the global registry).
->action(
SpotlightAction::make('log-out')
->label('Log out')
->icon('heroicon-o-arrow-right-on-rectangle')
->keywords(['signout', 'quit'])
->group('Account')
->url(fn () => filament()->getLogoutUrl()),
)
->actions([
SpotlightAction::make('impersonate')->label('Impersonate user')->url('/impersonate'),
])
// Hide actions registered in the global registry by name. Plugin-scoped
// actions with the same name automatically override their global twin,
// so overrideActions() is only needed when you want to hide without
// replacing.
->overrideActions(['legacy-action'])
// Skip the auto-generated "Create {Resource}" entries entirely.
->disableCreateActions()
// Remove Filament's in-topbar global search input in favor of the overlay.
->disableDefaultGlobalSearch();