PHPackages                             dvictor357/laravel-omnisearch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. dvictor357/laravel-omnisearch

ActiveLibrary[Search &amp; Filtering](/categories/search)

dvictor357/laravel-omnisearch
=============================

A global command palette (Cmd+K) for Laravel applications. Search models, navigate routes, and execute commands from anywhere.

2.0.0(3mo ago)11MITPHPPHP ^8.2

Since Dec 31Pushed 3mo agoCompare

[ Source](https://github.com/dvictor357/laravel-omnisearch)[ Packagist](https://packagist.org/packages/dvictor357/laravel-omnisearch)[ RSS](/packages/dvictor357-laravel-omnisearch/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Laravel OmniSearch
==================

[](#laravel-omnisearch)

A **global command palette** (`Cmd+K` / `Ctrl+K`) for Laravel 11/12 applications. Search models, navigate routes, execute commands, and more from anywhere in your app.

[![Latest Version on Packagist](https://camo.githubusercontent.com/065e1b9c653259a97e11e3e1bbda1e0c5214d5abf7109b3718829d5834f9e8cf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64766963746f723335372f6c61726176656c2d6f6d6e697365617263682e737667)](https://packagist.org/packages/dvictor357/laravel-omnisearch)[![Total Downloads](https://camo.githubusercontent.com/a61305d075950948bc03e7c504e084581d59846320a672e603742d0147194b31/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64766963746f723335372f6c61726176656c2d6f6d6e697365617263682e737667)](https://packagist.org/packages/dvictor357/laravel-omnisearch)[![License](https://camo.githubusercontent.com/66705230742d31c73198c2314c2f6aae06dfb29719d62fca076bb10d1356f96a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c6963656e73652f64766963746f723335372f6c61726176656c2d6f6d6e697365617263682e737667)](https://packagist.org/packages/dvictor357/laravel-omnisearch)

[![OmniSearch Screenshot](docs/screenshot.png)](docs/screenshot.png)

Features
--------

[](#features)

### Core Features

[](#core-features)

- 🔍 **Global Search** – Search across models, routes, and custom sources
- ⌨️ **Keyboard-First** – Full keyboard navigation (`↑`, `↓`, `Enter`, `Esc`, `Tab`)
- 🎨 **Premium UI** – Glassmorphism design with smooth animations
- 🔌 **Extensible** – Easy to add custom search sources
- ⚡ **Livewire 3** – Real-time search powered by Livewire
- 📊 **Relevance Scoring** – Results ranked by relevance, not just source order

### UX Enhancements

[](#ux-enhancements)

- 📝 **Recent Searches** – Stores and displays your search history
- 📋 **Copy to Clipboard** – Dedicated copy action type with toast notifications
- 🎯 **Multiple Action Types** – Navigate, copy, or open modals
- 🖼️ **Dynamic Icons** – Built-in icon system with 15+ icons
- 🎭 **Theming** – CSS variables for easy customization
- ♿ **Accessible** – Full ARIA support and screen reader compatible

### Developer Experience

[](#developer-experience)

- 🔧 **Artisan Commands** – `omnisearch:install`, `omnisearch:make-source`
- 📡 **Events** – Hook into search lifecycle with events
- 🌍 **i18n Ready** – Translations support out of the box
- 🧪 **Well Tested** – Comprehensive test coverage

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11.x or 12.x
- Livewire 3.x

Installation
------------

[](#installation)

```
composer require dvictor357/laravel-omnisearch
```

### Quick Setup

[](#quick-setup)

Run the installer command:

```
php artisan omnisearch:install
```

Or publish assets manually:

```
php artisan vendor:publish --tag=omnisearch-config
php artisan vendor:publish --tag=omnisearch-views
```

Add the component to your main layout (before ``):

```

```

Configuration
-------------

[](#configuration)

### Keyboard Shortcuts

[](#keyboard-shortcuts)

```
'shortcuts' => ['k', '/'],      // Multiple shortcuts supported
'modifier' => 'cmd',             // 'cmd', 'ctrl', or 'alt'
```

### Searchable Models

[](#searchable-models)

Configure which models should be searchable in `config/omnisearch.php`:

```
'models' => [
    App\Models\User::class => [
        'columns' => ['name', 'email'],    // Columns to search
        'title' => 'name',                 // Display title
        'description' => 'email',          // Display subtitle
        'route' => 'users.show',           // Named route (receives model ID)
        'icon' => 'user',                   // Icon identifier
        'limit' => 5,                      // Max results for this model
        'group' => 'Users',                // Custom group label (optional)
    ],
],
```

### Route Filtering

[](#route-filtering)

Control which routes appear in search:

```
'routes' => [
    'include' => ['*'],
    'exclude' => ['api.*', 'sanctum.*', 'livewire.*'],
],
```

### UI Customization

[](#ui-customization)

```
'ui' => [
    'placeholder' => 'Search anything...',
    'debounce' => 300,
    'max_results' => 10,
    'show_keyboard_hints' => true,
    'max_recent_searches' => 10,
    'enable_history' => true,
    'theme' => [
        'primary' => '#8b5cf6',
        'bg' => 'rgba(30, 30, 46, 0.85)',
        'radius' => '16px',
        'accent' => 'rgba(139, 92, 246, 0.3)',
    ],
],
```

### Search Settings

[](#search-settings)

```
'search' => [
    'use_scoring' => true,          // Enable relevance scoring
    'min_score' => 0,
    'highlight_matches' => true,
],
```

Creating Custom Sources
-----------------------

[](#creating-custom-sources)

### Basic Source

[](#basic-source)

Implement the `SearchSource` interface:

```
use OmniSearch\Contracts\SearchSource;
use OmniSearch\Data\Result;
use Illuminate\Support\Collection;

class MyCustomSource implements SearchSource
{
    public function getKey(): string
    {
        return 'custom';
    }

    public function getLabel(): string
    {
        return 'My Results';
    }

    public function getIcon(): string
    {
        return 'star';
    }

    public function authorize(): bool
    {
        return auth()->check();
    }

    public function getSynonyms(): array
    {
        return ['my-result', 'custom-result'];
    }

    public function getDependencies(): array
    {
        return [];
    }

    public function search(string $query): Collection
    {
        return collect([
            Result::navigate(
                id: 'custom:1',
                title: 'Custom Item',
                description: 'A custom search result',
                url: '/custom/1',
                icon: 'star',
                group: $this->getLabel(),
            ),
        ]);
    }
}
```

### Command Source with Dependencies

[](#command-source-with-dependencies)

Use the `CommandSource` base class for commands with dependencies:

```
use OmniSearch\Sources\CommandSource;
use OmniSearch\Data\Result;
use Illuminate\Support\Collection;

class CreateUserCommand extends CommandSource
{
    public function getKey(): string
    {
        return 'create-user';
    }

    public function getLabel(): string
    {
        return 'Create User';
    }

    public function getIcon(): string
    {
        return 'user-plus';
    }

    public function getDependencies(): array
    {
        return [
            'team' => App\Search\TeamSearchDependency::class,
        ];
    }

    public function search(string $query): Collection
    {
        return collect([
            Result::modal(
                id: 'command:create-user',
                title: 'Create New User',
                description: 'Open user creation form',
                modalName: 'create-user-modal',
                icon: 'user-plus',
                group: 'Commands',
            ),
        ]);
    }

    public function execute(...$args): mixed
    {
        // Command execution logic
    }
}
```

### Copy Action Result

[](#copy-action-result)

Create results that copy text to clipboard:

```
Result::copy(
    id: 'copy:email',
    title: 'Copy Email',
    description: 'Click to copy user email',
    textToCopy: $user->email,
    icon: 'copy',
    group: 'Actions',
);
```

Register in `config/omnisearch.php`:

```
'sources' => [
    OmniSearch\Sources\ModelSource::class,
    OmniSearch\Sources\RouteSource::class,
    App\Search\MyCustomSource::class, // Add your source
],
```

Events
------

[](#events)

OmniSearch fires events you can listen to:

```
use OmniSearch\Events\SearchPerformed;
use OmniSearch\Events\ResultSelected;
use OmniSearch\Events\ModalOpened;

// Listen for search events
Event::listen(SearchPerformed::class, function ($event) {
    // $event->query, $event->resultsCount, $event->duration
});

// Listen for result selection
Event::listen(ResultSelected::class, function ($event) {
    // $event->id, $event->title, $event->actionType, $event->url
});

// Listen for modal open
Event::listen(ModalOpened::class, function ($event) {
    // $event->trigger
});
```

Artisan Commands
----------------

[](#artisan-commands)

```
# Install OmniSearch assets
php artisan omnisearch:install

# Create a new search source
php artisan omnisearch:make-source MyCustom

# Clear search cache
php artisan omnisearch:clear-cache
```

Available Icons
---------------

[](#available-icons)

IconNameDescription🔍`search`Search icon👤`user`User/profile🔗`link`Links/routes📋`copy`Copy action✅`check`Success/check📄`file`File/document🗃️`database`Database/models⚙️`settings`Settings✨`sparkles`AI/featured📐`expand`Modal/action🕐`clock`History/timeContributing
------------

[](#contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](https://github.com/dvictor357/laravel-omnisearch/security/policy) on how to report security vulnerabilities.

License
-------

[](#license)

Laravel OmniSearch is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance82

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~37 days

Total

2

Last Release

95d ago

Major Versions

1.0.0 → 2.0.02026-02-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/bc63d4428a6985b06416109b00d9a5947df245f43b3897b16168815f330b4383?d=identicon)[dvictor357](/maintainers/dvictor357)

---

Top Contributors

[![dvictor357](https://avatars.githubusercontent.com/u/187467850?v=4)](https://github.com/dvictor357 "dvictor357 (4 commits)")

---

Tags

searchlaravellivewirespotlightcommand-paletteomnisearch

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dvictor357-laravel-omnisearch/health.svg)

```
[![Health](https://phpackages.com/badges/dvictor357-laravel-omnisearch/health.svg)](https://phpackages.com/packages/dvictor357-laravel-omnisearch)
```

###  Alternatives

[mailerlite/laravel-elasticsearch

An easy way to use the official PHP ElasticSearch client in your Laravel applications.

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

397612.3k](/packages/jeroen-g-explorer)[marcorieser/statamic-live-search

A Statamic Live Search realized with Laravel Livewire.

2210.5k](/packages/marcorieser-statamic-live-search)[kirschbaum-development/livewire-filters

Livewire Filters is a series of Livewire components that provide you with the tools to do live filtering of your data from your own Livewire components.

164.1k](/packages/kirschbaum-development-livewire-filters)[remoblaser/search

A simple to implement Search for your Application

101.5k](/packages/remoblaser-search)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
