PHPackages                             kainiklas/filament-scout - 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. kainiklas/filament-scout

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

kainiklas/filament-scout
========================

Filament Plugin to integrate Scout into Global Search and Table Search.

v1.1.0(3mo ago)3573.3k—1.6%12[2 issues](https://github.com/kainiklas/filament-scout/issues)[4 PRs](https://github.com/kainiklas/filament-scout/pulls)MITPHPPHP ^8.2CI passing

Since Dec 14Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/kainiklas/filament-scout)[ Packagist](https://packagist.org/packages/kainiklas/filament-scout)[ Docs](https://github.com/kainiklas/filament-scout)[ GitHub Sponsors](https://github.com/kainiklas)[ RSS](/packages/kainiklas-filament-scout/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (12)Versions (13)Used By (0)

Filament Scout Plugin
=====================

[](#filament-scout-plugin)

[![Latest Version on Packagist](https://camo.githubusercontent.com/dba5c07edf7d57700cb9f874cffd410871d567c02b8e5a8021164ebb9c0a96d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b61696e696b6c61732f66696c616d656e742d73636f75742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kainiklas/filament-scout)[![GitHub Tests Action Status](https://camo.githubusercontent.com/99a4f1f0fffc49840131ac283b1c1c4dd3b86e749397e98d4a98e4cfee4a5787/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b61696e696b6c61732f66696c616d656e742d73636f75742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/kainiklas/filament-scout/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/316009c4c3bed6030b4265f804cf45d0d1453abdd93095101c6ebe9621b26c51/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b61696e696b6c61732f66696c616d656e742d73636f75742f6669782d7068702d636f64652d7374796c696e672e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/kainiklas/filament-scout/actions?query=workflow%3A%22Fix+PHP+code+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/e969c871eda8221a3515ebb8499118ad16b129deb66c854256e3ebfcbc9d1a5c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b61696e696b6c61732f66696c616d656e742d73636f75742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kainiklas/filament-scout)

[![Filament Scout Plugin](https://raw.githubusercontent.com/kainiklas/filament-scout/main/art/filament-scout.jpeg)](https://raw.githubusercontent.com/kainiklas/filament-scout/main/art/filament-scout.jpeg)

Plugin to integrate Laravel Scout into Filament **Global Search** and **Table Search**. Plus a **ScoutSelect component** which enhances the standard Select Field with scout search capabilities.

Pre-Requesites
--------------

[](#pre-requesites)

- [Laravel Scout](https://laravel.com/docs/12.x/scout): Install and configure Laravel Scout as described in the Laravel Docs.

Supported Filament Versions
---------------------------

[](#supported-filament-versions)

Filament VersionFilament Scout Version30.x41.04 / 51.1Installation
------------

[](#installation)

You can install the package via composer:

```
composer require kainiklas/filament-scout
```

Table Search
------------

[](#table-search)

To use Scout Search instead of the default search on a table, add the trait `InteractsWithScout` to any Page which contains a table, e.g. `app\Filament\Resources\MyResource\Pages\ListMyResources.php`:

```
use Kainiklas\FilamentScout\Traits\InteractsWithScout;

class ListMyResources extends ListRecords
{
    use InteractsWithScout;
}
```

The table defined in the resource needs to be `searchable()` as described in the [Filament table docs](https://filamentphp.com/docs/4.x/tables/overview#searching-records-with-laravel-scout). Making each column searchable is not required anymore, as the content of what is searchable is defined within scout.

### Increase the number of search results

[](#increase-the-number-of-search-results)

Depending on the scout engine you may have limitations on how many search results you get back. This can be adjusted in two places:

#### 1. Search Limit

[](#1-search-limit)

Add the following `env` variable to adjust the limit of search results:

```
SCOUT_SEARCH_LIMIT=100

```

`100` is the default value within this pagacke. For example meilisearch has a default limit of `20`.

#### 2. Index Settings (Example for meilisearch)

[](#2-index-settings-example-for-meilisearch)

Within meilisearch there is a default limit of `1000` total hits which is also the upper bound for the search limit. That means if you want to have more than `1000` search results, you need to adapt both: the search limit and the index settings. The index settings can be adjusted within `config\scout.php`:

```
'index-settings' => [
  MyClass::class => [
    'pagination' => [
      'maxTotalHits' => 10000
    ],
  ],
],
```

Then run the following command to sync the settings: `php artisan scout:sync-index-settings`

Global Search
-------------

[](#global-search)

1. Check how to enable [Global Search in the Filament Documentation](https://filamentphp.com/docs/4.x/resources/global-search).
    - Set a `$recordTitleAttribute` on your resource: [Setting global search result title](https://filamentphp.com/docs/4.x/resources/global-search#setting-global-search-result-titles).
    - (Optional) Add details by implementing the method `getGlobalSearchResultDetails(Model $record)` in your Resource: [Adding extra details to global search results](https://filamentphp.com/docs/4.x/resources/global-search#adding-extra-details-to-global-search-results).

```
class ContractResource extends Resource
{
    // required to enable global search
    protected static ?string $recordTitleAttribute = 'name';

    // optional: details
    public static function getGlobalSearchResultDetails(Model $record): array
    {
        return [
            'Category' => $record->category->name,
        ];
    }
}
```

2. Add the Plugin `FilamentScoutPlugin` to your panel configuration, e.g., in `app\Providers\Filament\AdminPanelProvider.php`.

```
use Kainiklas\FilamentScout\FilamentScoutPlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->plugins([
                FilamentScoutPlugin::make()
            ]);
    }
}
```

### Meilisearch

[](#meilisearch)

If you are using [Meilisearch](https://www.meilisearch.com/), you can activate meilisearch specific features (search context highlighting):

1. Configure the plugin.

```
use Kainiklas\FilamentScout\FilamentScoutPlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->plugins([
                FilamentScoutPlugin::make()
                    ->useMeilisearch() // enables meilisearch specific features
            ]);
    }
}
```

2. (Optional) Implement/ Adapt `getGlobalSearchResultDetails()` in your Resource:

```
public static function getGlobalSearchResultDetails(Model $record): array
    {
        // change the filament default implementation from this
        // return [
        //     'AttributeTitle' => $record->attribute_name
        // ];

        // to this
        return [
            'scout_attribute_name' => "AttributeTitle"
        ];
    }
```

Select Form Field
-----------------

[](#select-form-field)

To enable scout search in your select form fields use the provided `ScoutSelect` component:

```
use Kainiklas\FilamentScout\Forms\Components\ScoutSelect;

ScoutSelect::make('company_id')
    ->searchable()
    ->relationship('company', 'name')
    ->useScout() // must be called after relationship()
```

Technically, the `ScoutSelect` component inherits from `Filament\Forms\Components\Select`. The `useScout()` method sets a new `getSearchResultsUsing()` closure which uses scout.

**Important**: The `useScout()` method needs to be called *after* the relationship method. Otherwise it is overriden by the `relationship()` method.

*Hint*: Only values which are accessible and defined by scout are searchable.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

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

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Kai Niklas](https://github.com/kainiklas)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance85

Actively maintained with recent releases

Popularity45

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~111 days

Recently: every ~167 days

Total

8

Last Release

107d ago

Major Versions

v0.5.0 → v1.0.02025-11-13

PHP version history (2 changes)v0.0.1PHP ^8.1

v1.0.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![kainiklas](https://avatars.githubusercontent.com/u/9416642?v=4)](https://github.com/kainiklas "kainiklas (37 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (24 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (18 commits)")[![RonMelkhior](https://avatars.githubusercontent.com/u/1017721?v=4)](https://github.com/RonMelkhior "RonMelkhior (1 commits)")

---

Tags

filamentfilament-pluginfilamentphpfilamentpluginlaravellaravel-scoutmeilisearchmeilisearch-phpphplaravelfilamentfilamentphpkainiklasfilament-scout

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/kainiklas-filament-scout/health.svg)

```
[![Health](https://phpackages.com/badges/kainiklas-filament-scout/health.svg)](https://phpackages.com/packages/kainiklas-filament-scout)
```

###  Alternatives

[dotswan/filament-map-picker

Easily pick and retrieve geo-coordinates using a map-based interface in your Filament applications.

124139.3k2](/packages/dotswan-filament-map-picker)[relaticle/custom-fields

User Defined Custom Fields for Laravel Filament

15828.6k](/packages/relaticle-custom-fields)[jibaymcs/filament-tour

Bring the power of DriverJs to your Filament panels and start a tour !

12247.8k](/packages/jibaymcs-filament-tour)[webbingbrasil/filament-advancedfilter

Advanced filter component for filament admin.

146132.1k](/packages/webbingbrasil-filament-advancedfilter)[guava/filament-modal-relation-managers

Allows you to embed relation managers inside filament modals.

7565.0k4](/packages/guava-filament-modal-relation-managers)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

5925.8k](/packages/marcelweidum-filament-passkeys)

PHPackages © 2026

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