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

Spotlight Laravel Package

wire-elements/spotlight

Livewire Spotlight adds an Alfred-like command palette to Laravel. Open with configurable keyboard shortcuts or toggle via events, then search, navigate, and run actions from a sleek input bar. Easy Composer install and Livewire directive.

View on GitHub
Deep Wiki
Context7

Livewire component that provides Spotlight/Alfred-like functionality to your Laravel application.

Frequently asked questions about Spotlight
How do I install Wire Elements Spotlight in a Laravel Livewire project?
Run `composer require wire-elements/spotlight` and add `@livewire('livewire-ui-spotlight')` to your Blade layout. For Livewire v2, include Alpine.js via CDN or bundle. No migrations or complex setup are required.
Does Spotlight work with Livewire v3?
Yes, Spotlight is fully compatible with Livewire v3. Alpine.js is no longer required since Livewire v3 includes it natively. Just install the package and use the `@livewire` directive as usual.
Can I customize the keyboard shortcuts for Spotlight?
Yes, you can configure the keybindings in the package’s config file. Defaults include CMD/CTRL+K and CMD/CTRL+/, but you can override them to match your app’s workflow.
How do I programmatically trigger Spotlight from a Livewire component?
Use `$this->dispatchBrowserEvent('toggle-spotlight')` in Livewire v2 or `$this->dispatch('toggle-spotlight')` in Livewire v3. You can also trigger it via JavaScript using `window.Livewire.dispatch('toggle-spotlight')`.
Is Spotlight compatible with Laravel 8+ and Livewire v2?
Yes, Spotlight supports Laravel 8+ and Livewire v2, but Livewire v3 is recommended. For Livewire v2, ensure Alpine.js is included, either via CDN or your asset pipeline.
How can I add custom commands to Spotlight?
Extend the `SpotlightCommand` class and register your custom commands in the `SpotlightServiceProvider`. Override methods like `shouldBeShown()` for role-based visibility or `handle()` for custom logic.
Will Spotlight work with non-TailwindCSS Laravel apps?
Yes, Spotlight is Tailwind-centric by default but can be customized. Set `include_css: true` in the config or publish the views to override the default styles with your own CSS.
Are there performance concerns with Spotlight in large applications?
Spotlight is lightweight, but heavy command lists may impact performance. Optimize by lazy-loading commands or paginating search results. Test frequently toggled scenarios to ensure smooth UI responsiveness.
Can I restrict Spotlight commands based on user roles?
Yes, use the `shouldBeShown()` method in your custom commands to check Laravel’s Gates, Policies, or user roles. This dynamically hides/shows commands based on authentication and authorization.
What happens if a Spotlight command fails (e.g., validation errors)?
Failed commands can be handled by overriding the `handle()` method in your custom command class. Use Laravel’s validation or exception handling to provide feedback, like showing toast notifications or error messages.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation
uri-template/tests