Download the PHP package manggala/laravel-spotlight without Composer
On this page you can find all versions of the php package manggala/laravel-spotlight. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download manggala/laravel-spotlight
More information about manggala/laravel-spotlight
Files in manggala/laravel-spotlight
Package laravel-spotlight
Short Description Production-ready, keyboard-driven Command Palette (Cmd+K) package for Laravel and Inertia.js applications.
License MIT
Homepage https://github.com/IlhamHattaManggala/laravel-spotlight
Informations about the package laravel-spotlight
Laravel Spotlight ๐
Laravel Spotlight (manggala/laravel-spotlight) is a production-ready, keyboard-first Command Palette (Cmd+K / Ctrl+K) package designed specifically for Laravel applications powered by Inertia.js and React.
๐ก Why Laravel Spotlight?
In the Laravel ecosystem, popular command palette tools (like Filament or wire-elements/spotlight) are 100% bound to Livewire and Blade. Applications built with Inertia.js were left without a server-driven command palette package.
Laravel Spotlight bridges this gap by introducing a Server-Driven UI (SDUI) engine. You define commands, model search providers, authorization policies, and route actions entirely in PHP. The package automatically injects authorized payloads into Inertia shared props, rendered seamlessly by a high-performance React modal overlay.
๐ Key Features
- Global Keyboard Shortcut: Toggle modal search anywhere using
Cmd + K(macOS) orCtrl + K(Windows/Linux). - Server-Driven Definition: Define commands fluently in PHP where your routes, models, and policies live.
- Instant Client & Async Server Search: Static actions filter instantly (< 10ms); dynamic Eloquent model searches stream asynchronously with debouncing (< 150ms).
- Eloquent Model Search Provider: Register searchable models (Users, Orders, Products, Customers) effortlessly.
- RBAC & Gate Integration: Automatically respects Laravel Gates, Policies, and Spatie Roles/Permissions.
- Categorized Section Grouping: Organize results visually into Navigation, Settings, Actions, and Models.
- Accessibility First: 100% WCAG 2.1 AA keyboard navigation (Arrow Up/Down, Enter, Escape focus trapping).
- Manggala Ecosystem Interoperability: Auto-indexes setting groups from
manggala/laravel-manifest(laravel-settings) and deep-links to dashboards frommanggala/laravel-dashboard-builder.
๐ฆ Installation
Install the package via Composer:
Run the package installation command to publish configuration and Inertia React component views:
Optionally publish resources manually:
๐ Quick Start
1. Registering Static Navigation Commands
Define application commands in your AppServiceProvider or dedicated Service Provider using the fluent Spotlight Facade:
2. Dynamic Eloquent Model Search Provider
Search across database models fluently with debounced async queries:
3. Role & Gate Authorization
Restrict commands based on user permissions or roles:
4. Mounting Frontend Component in Inertia Layout
Include the <SpotlightModal /> overlay component inside your primary Inertia React layout file (e.g. AuthenticatedLayout.tsx):
โ๏ธ Configuration Reference
The published configuration file (config/spotlight.php) allows fine-tuning keybindings and search thresholds:
๐ ๏ธ Artisan Commands
| Command | Description |
|---|---|
php artisan spotlight:install |
Interactive wizard to publish configuration and Inertia React component views. |
php artisan spotlight:clear |
Clear cached command indexes and registry stores. |
php artisan spotlight:doctor |
Run diagnostic health check on registered commands, gates, and middleware. |
๐ Ecosystem Interoperability
Laravel Spotlight integrates natively with the Manggala Ecosystem:
manggala/laravel-manifest(laravel-settings): Automatically discovers and registers configuration sections so users can search settings (e.g. "SMTP Password", "Maintenance Mode") viaCmd+K.manggala/laravel-dashboard-builder: Auto-indexes visual dashboards created with the dashboard builder for instant navigation.manggala/laravel-status-page: Adds quick commands for running system diagnostic checks directly from the command palette.
๐งช Testing & Code Quality
Run the Pest PHP test suite:
Format code styling with Laravel Pint:
Run static analysis with Larastan / PHPStan (Level 8):
๐ License
The MIT License (MIT). Please see LICENSE for more information.
All versions of laravel-spotlight with dependencies
illuminate/contracts Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/http Version ^10.0 || ^11.0 || ^12.0 || ^13.0