PHPackages                             marcorieser/statamic-live-search - 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. marcorieser/statamic-live-search

ActiveStatamic-addon[Search &amp; Filtering](/categories/search)

marcorieser/statamic-live-search
================================

A Statamic Live Search realized with Laravel Livewire.

v3.2.0(1mo ago)2210.5k↓30.4%15[1 issues](https://github.com/marcorieser/statamic-live-search/issues)[1 PRs](https://github.com/marcorieser/statamic-live-search/pulls)MITPHPPHP ^8.1

Since Jan 29Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/marcorieser/statamic-live-search)[ Packagist](https://packagist.org/packages/marcorieser/statamic-live-search)[ GitHub Sponsors](https://github.com/marcorieser)[ RSS](/packages/marcorieser-statamic-live-search/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (26)Used By (0)

Statamic Live Search
====================

[](#statamic-live-search)

[![Statamic 3.0+](https://camo.githubusercontent.com/93c61a311851e398f5663226aca5d307d91ef898067c6b294110a785d6c2e735/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53746174616d69632d332e302b2d4646323639453f7374796c653d666f722d7468652d6261646765266c696e6b3d68747470733a2f2f73746174616d69632e636f6d)](https://camo.githubusercontent.com/93c61a311851e398f5663226aca5d307d91ef898067c6b294110a785d6c2e735/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53746174616d69632d332e302b2d4646323639453f7374796c653d666f722d7468652d6261646765266c696e6b3d68747470733a2f2f73746174616d69632e636f6d)[![Latest Version on Packagist](https://camo.githubusercontent.com/00d71fc52910c40901f2a33fd76d38c65d1d311e2138a1f50644fdbaee238427/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6172636f7269657365722f73746174616d69632d6c6976652d7365617263682e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/marcorieser/statamic-live-search)

> A Statamic Live Search realised with [Laravel Livewire](https://laravel-livewire.com/).

It's fast to implement, hooks into the Statamic 3 core search and updates search results as you type.

[![Statamic Live Search](https://github.com/marcorieser/statamic-live-search/raw/main/statamic-live-serach.gif?raw=true)](https://github.com/marcorieser/statamic-live-search/blob/main/statamic-live-serach.gif?raw=true)

This Package extends my third-party [Statamic 3 Livewire integration](https://github.com/marcorieser/statamic-livewire).

No need for live search?
------------------------

[](#no-need-for-live-search)

Check out my [Statamic 3 Livewire integration](https://github.com/marcorieser/statamic-livewire).

Upgrading
---------

[](#upgrading)

Check out the upgrade guide: [Upgrade Guide](#upgrade-guide)

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

[](#installation)

Pull in the package with composer

```
composer require marcorieser/statamic-live-search
```

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

[](#requirements)

- PHP &gt;= 8.1
- Laravel 10 | 11 | 12
- Statamic 4 | 5

Set up Livewire
---------------

[](#set-up-livewire)

The option to create your first search provides a quick-start example to get you going.

As the statamic-live-search extends the statamic-livewire addon, the setup is exactly the same and a deeper understanding might be useful. See the link below for more information.

[Statamic 3 Livewire integration Docs](https://github.com/marcorieser/statamic-livewire#general-documentation)

Create your first search
------------------------

[](#create-your-first-search)

Add the `livewire:search` component to one of your templates and define your template.

```

    ...
    {{ livewire:styles }}

    {{ livewire:search }}

    ...
    {{ livewire:scripts }}

    ...
    @livewireStyles

    ...
    @livewireScripts

```

Setup the template
------------------

[](#setup-the-template)

### Use the default dropdown layout

[](#use-the-default-dropdown-layout)

To get you started as fast as possible, we provide a default template. You can publish it and edit it according to your needs.

```
php artisan vendor:publish --tag=live-search:views
```

After publishing, you will find the template inside `resources/views/vendor/live-search/dropdown.blade.php`. It can be edited as you like.

### Use your own template

[](#use-your-own-template)

Create your own template and put it anywhere you like. Define the template in the tag and you are ready to go.

If you need augmented values - as in the case of images - it's easiest to use Antlers, so you don't need to worry about it.

```

{{ livewire:search template='partials.your-own-search-template' }}

```

If the template name is `partials.search`, the template is expected at `resources\views\partials\search.blade.php` or `resources\views\partials\search.antlers.html`.

This might be a solid starting point for your own template:

#### Blade

[](#blade)

```

        @forelse($results as $result)
            {{ $result['title'] }}
        @empty
            No matches found
        @endforelse

```

#### Antlers

[](#antlers)

```

        {{ results }}
            {{ title }}
        {{ /results }}

```

Configure your index
--------------------

[](#configure-your-index)

This is the best bit. This addon hooks into Statamic core search. Just configure your indexes in the `config/statamic/search.php` file.

If you don't provide an index we will search everything. That's great for smaller sites.

A more specific search could look something like this:

```
'blog' => [
     'driver' => 'local',
     'searchables' => 'collection:blog',
     'fields' => ['title'],
 ],
```

Remember to define the index in your component:

```

{{ livewire:search template='partials.search' index='blog' }}

```

To update your indexes run `php please search:update` [More information](https://statamic.dev/search#updating-indexes)

[See the Statamic docs for more information](https://statamic.dev/search#searchables)

Customize the search logic
--------------------------

[](#customize-the-search-logic)

The parts we have provided have been built in a modular fashion so you can easily extend them if you wish.

### Extend the Search Class

[](#extend-the-search-class)

#### 1. Create your own Livewire Controller

[](#1-create-your-own-livewire-controller)

`php artisan make:livewire YourCustomLivewireController`

#### 2. Extend the Search class

[](#2-extend-the-search-class)

```
namespace App\Your\Namespace;

use MarcoRieser\LiveSearch\Http\Livewire\Search;

class YourCustomLivewireController extends Search
{
    public $template;
    public $index;

    public function mount(string $template, string $index = null)
    {
        // You can pass these as parameters or they can be hardcoded.
        $this->template = $template;
        $this->index = $index;
    }

    public function render()
    {
        // Do your stuff here.

        return view($this->template, [
            'results' => $this->search($this->q, $this->index),
        ]);
    }
}
```

#### 2. Use the SearchFacade Controller

[](#2-use-the-searchfacade-controller)

It might be that you want to customize the name of the query string or that you want to use multiple filters.

You can import the SearchFacade trait and write a complete Livewire Controller as you need it.

`use MarcoRieser\LiveSearch\Traits\SearchFacade;`

The method we have provided expects the following parameters: `search($query, ?string $index = null, ?int $limit = 10)`

Have fun customizing.

Upgrade guide
-------------

[](#upgrade-guide)

### Version 1 to 2

[](#version-1-to-2)

Livewire will be updated to Version 3 under the hood. A full Livewire upgrade guide can be found here:

**Breaking change**

Use `wire:model.live` in your template, instead of `wire:model`

> In Livewire 3, wire:model is "deferred" by default (instead of by wire:model.defer). To achieve the same behavior as wire:model from Livewire 2, you must use wire:model.live.

Credits
-------

[](#credits)

Thanks to:

- [Caleb](https://github.com/calebporzio) and the community for building [Livewire](https://laravel-livewire.com/)
- [Austenc](https://github.com/austenc) for the marketplace preview image

Support
-------

[](#support)

I love to share with the community. Nevertheless, it does take a lot of work, time and effort.

[Sponsor me on GitHub](https://github.com/sponsors/marcorieser/) to support my work and this addon.

License
-------

[](#license)

This plugin is published under the MIT license. Feel free to use it and remember to spread the love.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance88

Actively maintained with recent releases

Popularity38

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 50.8% 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 ~81 days

Recently: every ~52 days

Total

24

Last Release

54d ago

Major Versions

v1.7.0 → v2.0.02023-10-18

v2.2.0 → v3.0.02025-03-24

v3.0.1 → v4.x-dev2025-11-06

PHP version history (4 changes)v1.0.0-beta.1PHP ^7.4 || ^8.0

v1.4.0PHP ^7.4 || ^8.0 || ^8.1

v2.0.0PHP ^8.1

v4.x-devPHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/182dfd043559a726306414781777e7c5960164230ca44e2703607194c296d54b?d=identicon)[marcorieser](/maintainers/marcorieser)

---

Top Contributors

[![jonassiewertsen](https://avatars.githubusercontent.com/u/38906163?v=4)](https://github.com/jonassiewertsen "jonassiewertsen (30 commits)")[![marcorieser](https://avatars.githubusercontent.com/u/2395800?v=4)](https://github.com/marcorieser "marcorieser (14 commits)")[![vaanholtje](https://avatars.githubusercontent.com/u/3084888?v=4)](https://github.com/vaanholtje "vaanholtje (5 commits)")[![enespolat24](https://avatars.githubusercontent.com/u/21336979?v=4)](https://github.com/enespolat24 "enespolat24 (2 commits)")[![jackmcdade](https://avatars.githubusercontent.com/u/44739?v=4)](https://github.com/jackmcdade "jackmcdade (1 commits)")[![mikemartin](https://avatars.githubusercontent.com/u/414211?v=4)](https://github.com/mikemartin "mikemartin (1 commits)")[![nigelhv](https://avatars.githubusercontent.com/u/17791527?v=4)](https://github.com/nigelhv "nigelhv (1 commits)")[![oakeddev](https://avatars.githubusercontent.com/u/113590939?v=4)](https://github.com/oakeddev "oakeddev (1 commits)")[![robdekort](https://avatars.githubusercontent.com/u/69107412?v=4)](https://github.com/robdekort "robdekort (1 commits)")[![stuartcusackie](https://avatars.githubusercontent.com/u/20210934?v=4)](https://github.com/stuartcusackie "stuartcusackie (1 commits)")[![titonova](https://avatars.githubusercontent.com/u/41286822?v=4)](https://github.com/titonova "titonova (1 commits)")[![hotmeteor](https://avatars.githubusercontent.com/u/378585?v=4)](https://github.com/hotmeteor "hotmeteor (1 commits)")

---

Tags

laravel-livewirestatamicstatamic-addonpluginsearchlivewireaddonstatamiclive

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/marcorieser-statamic-live-search/health.svg)

```
[![Health](https://phpackages.com/badges/marcorieser-statamic-live-search/health.svg)](https://phpackages.com/packages/marcorieser-statamic-live-search)
```

###  Alternatives

[mailerlite/laravel-elasticsearch

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

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[statamic-rad-pack/meilisearch

meilisearch search driver for Statamic

1661.7k](/packages/statamic-rad-pack-meilisearch)[reachweb/statamic-livewire-filters

Livewire filters for Statamic collections.

1710.5k](/packages/reachweb-statamic-livewire-filters)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

2381.5k10](/packages/marcorieser-statamic-livewire)[webdevstudios/cmb2-post-search-field

Custom field for CMB2 which adds a post-search dialog for searching/attaching other post IDs.

6647.7k2](/packages/webdevstudios-cmb2-post-search-field)[aerni/livewire-forms

A Statamic forms framework powered by Laravel Livewire

2912.8k](/packages/aerni-livewire-forms)

PHPackages © 2026

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