- How do I install livewire-ui/spotlight in a Laravel Livewire app?
- Run composer require livewire-ui/spotlight; the service provider is auto-discovered, so you do not register it manually. Publish the config file (and the view if you plan to customise styling) with the vendor:publish command. Register your commands in a service provider's boot() method, then drop the Spotlight component tag into your layout. A first working palette is comfortably a sub-day task for a developer already fluent in Livewire.
- Which Laravel and Livewire versions does Spotlight support?
- Spotlight targets Laravel 10 through 13 on PHP 8.1+ and requires Livewire 3; the supported ranges are declared explicitly in composer.json. Compatibility is widened with patch releases, and version 2.0.4 existed specifically to add Laravel 13 support, which is a positive maintenance signal. Because every new Laravel major needs a follow-up package patch, treat framework upgrades as a two-step process and check constraints before bumping. Avoid constraints that admit dev or pre-release framework branches into your lockfile.
- Do I need Tailwind CSS to use Spotlight?
- The shipped views are built with Tailwind utility classes, so an app already on Tailwind gets the polished modal with effectively no design work. If your front end uses another CSS system, you can publish the Blade view and restyle it, which converts a drop-in install into a small design task. If consistency with an existing component library matters, budget a design review and watch for purge or content-path misconfiguration, a classic cause of a modal that renders invisibly after a build change.
- How do I register a custom command in the Spotlight palette?
- Commands are added to the package's static command registry, typically from a service provider's boot() method with a one-line register() call. A command can wrap an Eloquent model, a named route, or an arbitrary callback, so navigation links, records, and app actions all live in one searchable list. Keep each registration close to the domain code it queries, and add authorization and tenant scoping in the same place rather than relying on the palette to filter results.
- Can Spotlight search Eloquent models and routes?
- Yes. Spotlight is search-driven but agnostic about what a command exposes: registered commands can be backed by Eloquent models, named routes, or plain closures. That means one palette can jump to a settings page, open a specific customer record, and trigger an action like "create invoice" from the same input. The package does not ship its own search index, so each command is responsible for supplying its own results.
- How do I stop users seeing data they should not access through the command palette?
- Spotlight imposes no scoping of its own, so a command that queries a model without a policy or tenant constraint can turn the palette into a search surface over records the user should not see. Resolve every command through the same policies and tenant scopes you use elsewhere, and enforce that rule in code review. Prefer commands that call policies or pre-scoped query builders over raw model lookups, and add a test asserting that a low-privilege user gets no results. The one-line register() ergonomics actively encourage under-scoped commands, so make scoping a written team convention.
- Can I change the ⌘K shortcut if it conflicts with other app shortcuts?
- The default Spotlight-style trigger is handled on the client with Alpine.js, which ships with Livewire, so it can collide with existing in-app shortcuts, browser defaults, or OS-level bindings. Audit those conflicts on every client you support, including macOS, Windows, and any embedded webviews, before shipping. If a collision exists, remap or disable the binding in the published config or view rather than training users around it.
- How does Spotlight perform with large data sets?
- Out of the box, results come from whatever each registered command exposes, which is often a per-keystroke LIKE query against Eloquent; that is fine for small admin corpora but degrades as the searchable set grows. At larger volumes, front the palette with Laravel Scout or a dedicated engine such as Meilisearch and have commands return those results instead. Benchmark with realistic data and add debouncing or a minimum query length before assuming the default behaviour scales.
- Is Spotlight accessible for keyboard-only and screen-reader users?
- Keyboard-driven navigation is the core interaction, but do not assume full compliance out of the box. Verify focus trapping, visible focus states, Escape-to-close, and screen-reader semantics with your own assistive-technology pass. Because the Blade view is publishable, you can add or adjust ARIA roles and labels if the defaults fall short of your bar. Treat an accessibility audit as part of integration rather than an optional extra.
- Is livewire-ui/spotlight still maintained, and what are the alternatives?
- It is a small-team, effectively single-maintainer open-source project, so weigh bus factor alongside the reassuringly quick Laravel 13 patch turnaround. Alternatives include building a bespoke Livewire palette, or the wire-elements/spotlight lineage and similar command-palette components; compare them on Livewire major support, Tailwind assumptions, and how each handles authorization scoping. If the palette becomes a core navigation surface, pin the version, follow the repository's release notes, and plan for a package major when Livewire itself moves to a new major.