Weave Code
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 Search Spotlight Laravel Package

wezlo/filament-search-spotlight

Full-screen Spotlight/command-palette search for Filament panels (⌘K/Ctrl+K). Aggregates global search records plus resources, pages, and actions, with recent/pinned items stored in localStorage. Keyboard navigation, configurable per panel and via config.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Pros:

    • Seamless Filament Integration: Designed specifically for Filament panels, leveraging its GlobalSearchProvider and resource architecture. Minimal boilerplate required (plugin registration + optional config).
    • Modular Design: Categories (records, resources, pages, actions) are decoupled, allowing granular customization or replacement (e.g., swap RecordsCategory for a custom implementation).
    • Client-Side Persistence: Recent/pinned items use localStorage, avoiding server-side state management. Ideal for user-specific preferences without DB migrations.
    • Action System: Fluent SpotlightAction API enables dynamic, context-aware actions (e.g., logout, cache clearing) with keywords for discoverability.
    • Tailwind Compatibility: Explicit support for compiled Tailwind themes via @source directive, preventing utility class purging.
  • Cons:

    • Tight Coupling to Filament: Assumes Filament’s resource/page structure (e.g., getGloballySearchableAttributes()). May require wrappers for non-Filament Laravel apps.
    • Limited Query Flexibility: Search relies on Filament’s built-in providers; advanced full-text search (e.g., Algolia) would need custom categories.
    • No Server-Side Caching: Recent/pinned items are client-only, which could lead to inconsistencies in multi-tab or shared-session scenarios.

Integration Feasibility

  • Low Effort: Installation is a one-liner (composer require) + plugin registration. No migrations, routes, or middleware required.
  • Tailwind Dependency: Requires Tailwind setup (common in Filament apps) and a rebuild step. Non-Tailwind projects would need manual CSS inclusion.
  • Testing: Feature tests are designed to run in the consumer app, easing CI/CD integration.

Technical Risk

  • Keyboard Conflicts: Default ⌘K/Ctrl+K binding might clash with existing shortcuts (e.g., Monaco editor). Configurable via keyBinding().
  • Performance: Heavy panels with many resources/pages could slow initial load or search. Mitigated by resultLimitPerCategory().
  • LocalStorage Quirks: Browser limits (5MB) or privacy modes (e.g., Safari) could affect recent/pinned functionality. No fallback mechanism.
  • Translation Gaps: Only 2 languages (English + Central Kurdish) in v1.0.1. Additional languages would require manual additions.

Key Questions

  1. Filament Version Compatibility:

    • What Filament v2.x/v3.x features does this package rely on? (e.g., filament()->getLogoutUrl())
    • Are there breaking changes planned in Filament that could impact this package?
  2. Search Customization:

    • How would we integrate third-party search (e.g., Scout, Meilisearch) into the RecordsCategory?
    • Can the fuzzy-matching algorithm for pages/resources be overridden?
  3. Action Scoping:

    • How are plugin-scoped actions prioritized vs. global registry actions? (Documentation states overrides but unclear about conflicts.)
    • Can actions be dynamically generated (e.g., based on user roles)?
  4. Accessibility:

    • Is the overlay keyboard-navigable without mouse input? (Documentation mentions arrow keys but no ARIA attributes.)
    • How does it handle screen readers or high-contrast modes?
  5. Multi-Panel Support:

    • Does the localStorage persistence work across multiple Filament panels in the same app?
    • Can pinned/recent items be synced between devices (e.g., via Laravel Sanctum)?
  6. Upgrade Path:

    • What’s the strategy for migrating from config file to fluent API (or vice versa)?
    • Are there backward-compatibility guarantees for custom categories/actions?

Integration Approach

Stack Fit

  • Primary Use Case: Laravel + Filament v2/3 applications where users need a unified search/navigation overlay (e.g., admin dashboards, SaaS platforms).
  • Anti-Patterns:
    • Non-Filament Laravel apps (would need significant refactoring).
    • Headless or API-only Laravel backends (no panel context).
  • Complementary Tools:
    • For Advanced Search: Pair with spatie/laravel-searchable for server-side indexing.
    • For Analytics: Track SpotlightAction usage via Laravel Mixins or Filament’s event system.

Migration Path

  1. Pilot Phase:

    • Install in a non-production Filament panel (e.g., admin.test).
    • Test with 2–3 key resources/pages to validate search results and keyboard navigation.
    • Verify Tailwind rebuild step in CI/CD (add npm run build to deployment scripts).
  2. Core Integration:

    • Register plugin in PanelProvider:
      ->plugins([
          FilamentSearchSpotlightPlugin::make()
              ->keyBinding('mod+k')
              ->excludeResources([AuditLogResource::class])
              ->action(SpotlightAction::make('custom-action')->...),
      ])
      
    • Publish config if using non-default settings (e.g., php artisan vendor:publish --tag=filament-search-spotlight-config).
  3. Customization:

    • Replace default categories (e.g., swap RecordsCategory for a Scout-powered search).
    • Register global actions in AppServiceProvider::boot():
      SpotlightAction::make('export-data')
          ->label('Export CSV')
          ->keywords(['export'])
          ->url(fn () => route('admin.exports.csv'))
          ->register();
      
  4. Rollout:

    • Disable Filament’s default global search (->disableDefaultGlobalSearch()) to avoid duplication.
    • Monitor localStorage usage in production (e.g., via browser dev tools).

Compatibility

  • Filament Versions: Tested against Filament v3 (based on release date 2026). Check composer.json for filament/support version constraints.
  • PHP Versions: Likely requires PHP 8.1+ (common for Filament v3). Verify wezlo/filament-search-spotlight’s composer.json.
  • Browser Support: Relies on modern JS features (e.g., localStorage, Mousetrap.js). Test in target browsers (e.g., Chrome, Firefox, Safari).

Sequencing

  1. Pre-requisites:
    • Filament panel with at least one resource/page.
    • Tailwind CSS setup (if using compiled themes).
  2. Installation:
    • composer require wezlo/filament-search-spotlight
    • Register plugin in PanelProvider.
  3. Configuration:
    • Publish config (if needed).
    • Customize via fluent API or config file.
  4. Testing:
    • Verify ⌘K trigger and keyboard navigation.
    • Test search across all categories (records, resources, etc.).
  5. Deployment:
    • Rebuild Tailwind assets.
    • Monitor for localStorage errors or performance issues.

Operational Impact

Maintenance

  • Proactive Tasks:
    • Tailwind Updates: Rebuild assets after wezlo/filament-search-spotlight updates (if views change).
    • Translation Updates: Add new languages manually to resources/lang/ (package doesn’t provide a translation loader).
    • Dependency Audits: Monitor wezlo/filament-search-spotlight for security patches (low risk; no direct DB access).
  • Reactive Tasks:
    • Keyboard Conflicts: Debug via browser console if ⌘K fails (e.g., event listeners in other plugins).
    • LocalStorage Corruption: Clear spotlight.recent/spotlight.pinned keys if data becomes stale (client-side tooling).

Support

  • Common Issues:
    • "Search not working": Verify GlobalSearchProvider implementation in resources.
    • Actions missing: Check excludeResources() or overrideActions() config.
    • Styling breaks: Ensure Tailwind @source directive is included and assets rebuilt.
  • Debugging Tools:
    • Browser DevTools: Inspect localStorage for recent/pinned items.
    • Filament Logs: Check for plugin initialization errors in storage/logs/laravel.log.
    • Feature Tests: Run php artisan test --compact tests/Feature/FilamentSearchSpotlight to validate core functionality.

**Scaling

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.
nasirkhan/laravel-sharekit
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony