Download the PHP package ifsware/filament-omnisearch without Composer
On this page you can find all versions of the php package ifsware/filament-omnisearch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ifsware/filament-omnisearch
More information about ifsware/filament-omnisearch
Files in ifsware/filament-omnisearch
Package filament-omnisearch
Short Description Powerful dynamic omnisearch plugin for Filament
License MIT
Informations about the package filament-omnisearch
Filament Omnisearch
A keyboard-first command palette for Filament v5. Press ⌘K / Ctrl+K from anywhere in your panel to instantly search navigation items, database records, resource actions, and custom commands — without leaving your current page.
Think of it as Spotlight or VS Code's command palette, built specifically for Filament. It replaces (or complements) Filament's native global search with a unified interface that covers everything: navigation, records, panel switching, page-specific actions, and any custom scope you register.
Preview
Features
- Keyboard-driven — Open with
⌘K/Ctrl+K, navigate with arrow keys, execute with Enter, trigger actions with custom shortcuts - Built-in Scopes — Navigation, Resources, Panels, Actions, and Page Actions out of the box
- Extensible — Add custom scopes by implementing
OmnisearchScope - Record Preview — Side panel showing resource field details when a result is active
- Recent Searches — Persisted per-browser with configurable toggle
- Page Actions — Auto-detect Create/List actions; discoverable from any page via search
- Dark Mode — Follows Filament's theme automatically
- Fuzzy Search — Smart matching with keyword support
- Multilingual — Built-in translations for English, Indonesian, and Dutch
Requirements
- PHP 8.2+
- Laravel 11+
- Filament v5
- Livewire v4
Installation
Register the plugin in your Filament panel provider:
Publish the config file:
What Works Out of the Box
After installation and registration, opening the omnisearch palette (⌘K / Ctrl+K) gives you five built-in scopes automatically.
1. Navigation Scope
Searches all visible navigation items registered in the current panel. No configuration needed — every item in your sidebar is immediately searchable.
2. Resource Scope
Searches records across all resources that have Filament's global search enabled. A resource is searchable only when it declares at least one of:
$recordTitleAttribute— the column used as the result titlegetGlobalSearchResultDetails()— method override returning fields shown in the subtitle and preview panel- A custom
getGlobalSearchResults()implementation
Minimal example — make a resource record searchable:
With detail fields shown in the preview panel:
If
$recordTitleAttributeis not set andgetGlobalSearchResultDetails()is not implemented, the resource will not appear in omnisearch results.
Scoping Resource Search Results
OmnisearchResourceScope uses Filament's built-in global search under the hood. For each searchable resource it calls getGlobalSearchEloquentQuery(), which by default delegates to getEloquentQuery().
This means your existing getEloquentQuery() scope is inherited by omnisearch — but only if it is always applied. If the scope is conditional (e.g. based on user role), omnisearch may bypass it when the condition is not met.
The safest approach is to override getGlobalSearchEloquentQuery() explicitly in your resource:
With this setup:
- Customers — omnisearch only returns their own orders
- Admins — omnisearch returns all orders (no scope applied)
Multi-panel apps — if the same model is exposed in multiple panels (e.g. an admin panel and a customer portal), each panel's
Resourceclass is independent. Apply scoping only in the portal resource; leave the admin resource untouched.
3. Panel Scope
Lists other Filament panels the authenticated user has access to. Useful in multi-panel applications (e.g. admin + customer portal). Results appear even without a search query, so users can switch panels from the palette.
Panel visibility requires
FilamentUser. The panel scope checks access by callingcanAccessPanel()on the authenticated user. This method is only available when yourUsermodel implementsFilament\Models\Contracts\FilamentUser. Without it, the scope falls back toapp()->environment('local')— meaning all panels are visible to all users in local development regardless of their role.To correctly restrict panel visibility, implement
FilamentUserand definecanAccessPanel():
4. Action Scope
Shows global actions registered on the plugin (see Global Actions below). Actions appear without a search query so they are always discoverable.
5. Page Actions Scope
Automatically discovers Create and List actions for every resource whose pages use the HasOmnisearchPageActions trait. Unlike the per-page chip, these results appear in search results from any page — not only when the user is currently on that resource's page.
Global Actions
Register application-level actions on the plugin using OmnisearchAction. Actions appear in the Actions group and can run any PHP callable.
OmnisearchAction fluent API:
| Method | Description |
|---|---|
title(string) |
Display title in the palette |
subtitle(string) |
Secondary text below the title |
icon(string) |
Heroicon name, e.g. heroicon-o-bolt |
keywords(array) |
Extra words used for fuzzy matching |
shortcut(string) |
Keyboard shortcut — shown as a badge in the result and registered as an active hotkey (see Keyboard Shortcuts) |
action(callable) |
PHP callable invoked when the action is executed |
Page Actions
Add HasOmnisearchPageActions to a resource page to expose Create and List actions in two places:
- Topbar chip — shown while the user is on that page, for quick one-click access
- Search results — available from any page via
OmnisearchPageActionsScope(see built-in scopes)
You only need to add the trait to one page per resource (typically the list page). The OmnisearchPageActionsScope scans all resource pages automatically, so Create/List actions will appear in search results regardless of which page the user is currently on.
When the page is active, omnisearch will show in the topbar:
- Create User — links to the resource create page (if it exists)
- Users — links back to the resource index (if it exists)
Adding Custom Page Actions
Override getOmnisearchActions() to inject page-specific actions alongside the auto-detected ones. A shortcut key registers an active keyboard hotkey — but only while the user is on that page:
For a shortcut that works from every page, register the action via
OmnisearchPlugin::make()->actions([...])instead — global actions are always mounted.
Custom Scopes
Implement OmnisearchScope to add any results you want. Each item must have a type of url, action, or modal.
URL item — navigates to a page
Action item — runs a PHP callable server-side
Modal item — opens a Livewire modal
Clipboard item — copies text to the clipboard
When selected, the value in text is written to the clipboard via the browser's Clipboard API. The item icon briefly changes to a checkmark, then the palette closes automatically.
OmnisearchAction also supports clipboard via the fluent API:
Register the scope
Add it to config/omnisearch.php:
Configuration
Plugin options
Multilingual Support
Filament Omnisearch ships with built-in translations for English (default), Indonesian, and Dutch. All UI strings — including placeholders, group labels, empty state messages, and footer shortcuts — are translatable.
Publish translations
This copies the language files to resources/lang/vendor/omnisearch/{en,id,nl}/. Edit them to customize wording or add new locales.
Override via config
You can still override specific strings globally via config/omnisearch.php. When a config value is set to a non-empty string, it takes precedence over the translation file.
Adding a new language
- Copy
resources/lang/en/omnisearch.php - Place it under
resources/lang/vendor/omnisearch/{locale}/omnisearch.php - Translate the values
No code changes are required — Laravel's localization system will pick up the new locale automatically.
Keyboard Shortcuts
Built-in
| Key | Action |
|---|---|
⌘K / Ctrl+K |
Open omnisearch |
Escape |
Close omnisearch |
↑ / ↓ |
Navigate results |
↵ |
Execute selected result |
Custom action shortcuts
Shortcuts defined via ->shortcut() or the shortcut key in an item array are active hotkeys — pressing them executes the action directly without opening the palette first.
Scope of custom shortcuts:
| Where defined | Active |
|---|---|
OmnisearchPlugin::make()->actions([...]) |
All pages, always |
getOmnisearchActions() on a page |
Only while on that page |
Shortcut format — use +-separated modifiers followed by a key:
mod resolves to Cmd on Mac and Ctrl on Windows/Linux. Other modifiers: ctrl, meta, shift, alt.
Avoid browser-reserved shortcuts. Common conflicts:
mod+shift+n(new incognito, Chrome),mod+shift+p(private window, Firefox),mod+shift+j(DevTools console),mod+shift+i(DevTools). Browser UI shortcuts are captured before the page sees them and cannot be overridden withpreventDefault().
Testing
License
MIT
All versions of filament-omnisearch with dependencies
filament/filament Version ^5.0
livewire/livewire Version ^4.0
spatie/laravel-package-tools Version ^1.16