pxlrbt / filament-spotlight
Spotlight for Filament Admin
Fund package maintenance!
pxlrbt
Installs: 188 392
Dependents: 2
Suggesters: 0
Security: 0
Stars: 242
Watchers: 4
Forks: 31
Open Issues: 0
Requires
- php: ^8.0
- filament/filament: ^3.0.0-stable
- wire-elements/spotlight: ^2.0
Requires (Dev)
- laravel/pint: ^1.10
- dev-main
- v1.3.0
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.1
- v1.0.0
- v0.3.8
- v0.3.7
- v0.3.6
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.1
- 0.2.0
- 0.1.0
- dev-Geoffry304/main
- dev-fix/nullable-get-url
- dev-fix/use-navigation-label
- dev-fix/prune-for-v3
- dev-feature/filament-v3
- dev-fix/fail-on-page-registration
- dev-fix/no-cache
- dev-feat/view-records
This package is auto-updated.
Last update: 2024-12-18 14:32:47 UTC
README
Filament Spotlight
Quickly navigate your Filament Resources with Spotlight functionality.
Supports pages, resources and links from the user menu.
demo.mp4
Installation
composer require pxlrbt/filament-spotlight
Assets
Publish the assets (Filament > 3)
php artisan filament:assets
Plugin registration
To use this plugin register it in your panel configuration:
use pxlrbt\FilamentSpotlight\SpotlightPlugin; $panel ->plugins([ SpotlightPlugin::make(), ]);
Usage
There is no configuration needed.
"its genius"
– Dan Harrin
To open the Spotlight input bar you can use one of the following shortcuts:
CTRL + K
CMD + K
CTRL + /
CMD + /
Setup
This plugin relies on the same properties and methods used for Filament's global search. For records showing up with the correct name in "Edit/View" you need to set $recordTitleAttribute
. Check the docs for more information
Excluding pages
If you need to exclude a page from the spotlight results you may do so by adding a static shouldRegisterSpotlight
method to the page and return false:
public static function shouldRegisterSpotlight(): bool { return false; }
This can be useful when you have pages that require URL parameters.
Translation
To translate or edit the default placeholder, you have to publish the translation file for wire-element/spotlight:
php artisan vendor:publish --tag=livewire-ui-spotlight-translations
Contributing
If you want to contribute to this packages, you may want to test it in a real Filament project:
- Fork this repository to your GitHub account.
- Create a Filament app locally.
- Clone your fork in your Filament app's root directory.
- In the
/filament-spotlight
directory, create a branch for your fix, e.g.fix/error-message
.
Install the packages in your app's composer.json
:
"require": { "pxlrbt/filament-spotlight": "dev-fix/error-message as main-dev", }, "repositories": [ { "type": "path", "url": "filament-spotlight" } ]
Now, run composer update
.