Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Spotlight Laravel Package

cswni/filament-spotlight

Filament Spotlight adds a fast, keyboard-driven command palette to your Filament panels, letting users quickly jump to resources, pages, and records without navigating menus. Simple to install and configure for faster admin workflows.

View on GitHub
Deep Wiki
Context7

Getting Started

The 1.0.0 release is the first stable tag for cswni/filament-spotlight, but the release notes contain nothing except an auto-generated changelog link. Treat the tag as a signal ("API is now considered stable") rather than a feature announcement, and read the repository README and the 1.0.0 commit list before adopting — there is no migration guide because there is no prior stable version to migrate from.

Minimal adoption path:

  1. composer require cswni/filament-spotlight — pin it ("^1.0") now that a stable tag exists; pre-1.0 installs should be bumped deliberately, since dev-main code may have shifted into the tagged release.
  2. Register the plugin on the panel(s) that should expose the palette, in the panel() method of your PanelProvider:
->plugins([
    \Cswni\FilamentSpotlight\SpotlightPlugin::make(),
])
  1. Run php artisan filament:assets (and php artisan optimize:clear in a cached environment) so the plugin's JS/CSS lands in public/.
  2. Open any panel page and press the palette shortcut (typically Cmd/Ctrl + K). If nothing appears, check the browser console first — a missing asset or a Livewire/Alpine version mismatch is far more common than a config problem.

First use case: global resource/page navigation. Before you invest in custom providers, confirm that the palette lists your Filament resources, their pages, and the cluster/navigation groups you expect. That single flow is where 90% of the value sits for day-to-day admin users, and it exercises the plugin's resource-introspection code, which is the part most sensitive to your Filament major version.

Implementation Patterns

Panel-scoped registration. Register the plugin only where it belongs. In multi-panel apps (e.g. admin + app), adding it to the admin panel keeps the palette out of customer-facing surfaces and avoids leaking resource labels to the wrong audience. If two panels share resources, prefer explicit per-panel registration over a shared base provider.

Replace, don't duplicate, Filament's global search. Filament ships a global search modal on the topbar. Running Spotlight alongside it produces two near-identical search affordances and two sets of keybindings. Pick one: either disable the stock global search on the panel or skip Spotlight. Document the decision in the panel provider so the next developer doesn't "helpfully" re-enable the other.

Custom commands as the primary extension point. The day-to-day pattern is registering app-specific actions — "Create invoice", "Open today's orders", "Impersonate user" — as spotlight entries that resolve to a URL or dispatch a Livewire action. Keep these definitions in a dedicated service provider or a SpotlightRegistry-style class rather than scattering them through resource classes; a single file is far easier to review for authorization mistakes.

Authorization must be explicit. Palette items are navigation shortcuts, so anything that appears there is effectively an advertisement of an endpoint. Wrap every custom entry (and, where the plugin allows it, resource entries) in the same policy check the destination route uses — ->visible(fn () => Gate::allows('viewAny', Order::class)). Do not rely on the target page's own authorization as your only line of defence: an entry that 403s on click is a bad UX and a mild information leak (it confirms the resource exists).

Tenancy. In a tenanted panel, confirm that palette results are scoped to the current tenant. Resource introspection typically runs through the panel's resource list, which is tenant-scoped, but custom entries are your responsibility — inject Filament::getTenant() into any query you run inside a command's resolution callback.

Keybinding hygiene. If the plugin exposes a configurable shortcut, set it centrally (config or plugin method) rather than per-developer. Document it in your team's onboarding notes: users coming from the stock global search will instinctively reach for the old shortcut.

Testing. Assert palette contents in a feature test rather than manually clicking: instantiate the panel, resolve the plugin, and assert that expected labels appear and unauthorized ones do not. This is cheap insurance against a resource rename silently dropping an entry.

Gotchas and Tips

  • 1.0.0 is a marketing milestone, not a code change you can read. With no changelog text, diff the tag against the last commit you actually deployed (git log --oneline <old-sha>..1.0.0 in the vendor fork or GitHub compare view) before upgrading a production app. If you were on a dev- constraint, Composer will not move you to 1.0.0 automatically — you must change the constraint.
  • Asset pipeline is the #1 failure mode. After install, upgrade, or a composer update, re-run php artisan filament:assets. In production with php artisan optimize, a stale asset manifest means the shortcut does nothing with no server-side error.
  • Keyboard shortcut conflicts. Cmd/Ctrl+K is claimed by browsers (address bar search), Slack-style embeds, and some editors. Test in Chrome, Safari, and Firefox before shipping to stakeholders; Safari in particular intercepts several Cmd combinations.
  • Search quality scales badly with resource count. On panels with 50+ resources and large navigation groups, verify palette open latency. If it feels sluggish, restrict which resources are exposed rather than optimizing after complaints.
  • N+1 risk in custom commands. A command that renders a count or a "3 pending" badge can fire a query per entry on every palette open. Cache counts (Cache::remember for 30–60s) or omit dynamic badges entirely.
  • SPA / wire:navigate interplay. In SPA-mode panels, confirm that navigating from the palette updates the URL and doesn't leave a stale modal in the DOM. If the modal lingers, it's usually an Alpine teardown issue — check for a duplicate x-data root.
  • Config caching. Any plugin config you publish must survive php artisan config:cache; closures in config files are the classic breakage. Prefer configuring via the plugin object in PanelProvider (code, not config) for anything non-scalar.
  • Debugging recipe. Palette empty → check php artisan about panel list, then whether the plugin is registered on that panel, then the browser console, then filament:assets. Palette visible but a section missing → the resource's shouldRegisterNavigation() or a policy is filtering it.
  • Extension points are the stable surface, not the internals. With a fresh 1.0.0 and a thin changelog, treat the plugin object's public methods and any documented command-registration API as the contract. Avoid subclassing internal classes or overriding views to tweak styling — those will break on a 1.x minor.
  • Documentation debt is real. The absence of release notes suggests the README is the only source of truth. Budget an hour for a spike before committing the team to the dependency, and record what you learn in your own repo's docs so the knowledge isn't lost.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel