PHPackages                             muhammad-nawlo/filament-scout-manager - 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. muhammad-nawlo/filament-scout-manager

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

muhammad-nawlo/filament-scout-manager
=====================================

A comprehensive Filament plugin for managing Laravel Scout indexes and search settings

v1.0.1(2mo ago)4481[2 PRs](https://github.com/Muhammad-Nawlo/filament-scout-manager/pulls)MITPHPPHP ^8.2CI passing

Since Mar 1Pushed 1mo agoCompare

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

READMEChangelog (1)Dependencies (28)Versions (24)Used By (0)

Filament Scout Manager
======================

[](#filament-scout-manager)

[![Latest Version on Packagist](https://camo.githubusercontent.com/901addca0a21c710967d35791cb5deb65e3c8010ca5758ee28f039edf8029541/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d7568616d6d61642d6e61776c6f2f66696c616d656e742d73636f75742d6d616e616765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/muhammad-nawlo/filament-scout-manager)[![GitHub Tests Action Status](https://camo.githubusercontent.com/8ff270af166f24016aae3fc3aae10efafa8c1f348a6fcc24bd4f12b6eef5b11c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d7568616d6d61642d6e61776c6f2f66696c616d656e742d73636f75742d6d616e616765722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/muhammad-nawlo/filament-scout-manager/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/2da4ca27e189cd1bed460cbfc36acb9d94362c123745685dc7d42fcaa175ec8e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d7568616d6d61642d6e61776c6f2f66696c616d656e742d73636f75742d6d616e616765722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/muhammad-nawlo/filament-scout-manager/actions?query=workflow%3A%22Fix+PHP+code+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/07da4ec8dcdf08bbf514af43816805d66f6accaa882ba9a93f236d6ca81cf464/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d7568616d6d61642d6e61776c6f2f66696c616d656e742d73636f75742d6d616e616765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/muhammad-nawlo/filament-scout-manager)

A Filament plugin to manage your Laravel Scout search setup from an admin panel.

Features
--------

[](#features)

- Discover Scout-searchable models and inspect index/engine metadata.
- Run index actions (import, flush, refresh) per model or in bulk.
- View index health and popular searches with dashboard widgets.
- Log user search queries for analysis.
- Manage search synonyms in the panel.
- Configure behavior with package config/settings.

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

[](#requirements)

- PHP 8.2+
- Laravel app with [Laravel Scout](https://laravel.com/docs/scout) configured
- Filament 5 panel

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

[](#installation)

Install the package:

```
composer require muhammad-nawlo/filament-scout-manager
```

Run the installer:

```
php artisan filament-scout-manager:install
```

Or manually publish package files:

```
php artisan vendor:publish --tag="filament-scout-manager-config"
php artisan vendor:publish --tag="filament-scout-manager-migrations"
php artisan migrate
```

If you use a custom Filament theme, add the package views as a Tailwind source:

```
@source '../../../../vendor/muhammad-nawlo/filament-scout-manager/resources/**/*.blade.php';
```

Register the plugin
-------------------

[](#register-the-plugin)

In your Filament panel provider, register the plugin:

```
use MuhammadNawlo\FilamentScoutManager\FilamentScoutManagerPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            FilamentScoutManagerPlugin::make(),
        ]);
}
```

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

[](#configuration)

Published config: `config/filament-scout-manager.php`

```
return [
    'log_searches' => true,
    'log_retention_days' => 30,
    'enable_synonyms' => true,
    'models' => [
        // 'App\\Other\\Model' => [],
    ],
];
```

Usage notes
-----------

[](#usage-notes)

- Ensure each model you want indexed uses Scout's `Searchable` trait.
- Configure your Scout driver (`SCOUT_DRIVER`) and engine credentials in `.env`.
- The "Searchable Fields" options in the panel are most useful when your model defines a custom `toSearchableArray()`.

Runtime overrides
-----------------

[](#runtime-overrides)

Stored model configuration (index name, searchable fields, engine) can be applied at runtime so that Scout uses the values you set in the Filament panel. This is **opt-in** and **fully backward compatible**.

- **No trait** → no override; the model behaves exactly like vanilla Scout.
- **With trait** → if a config is saved for that model in the panel, `searchableAs()`, `toSearchableArray()`, and `searchableUsing()` use the stored values; otherwise defaults are unchanged.

To enable runtime overrides on a model, use the `SearchableWithScoutManagerConfig` trait (it combines Scout’s `Searchable` with plugin config and avoids trait method collisions):

```
use Illuminate\Database\Eloquent\Model;
use MuhammadNawlo\FilamentScoutManager\Concerns\SearchableWithScoutManagerConfig;

class Product extends Model
{
    use SearchableWithScoutManagerConfig;
}
```

If you prefer to use `Searchable` and `UsesScoutManagerConfig` separately, you must resolve the trait collision for `searchableUsing`, `searchableAs`, and `toSearchableArray` with `insteadof`; see the docblock on `UsesScoutManagerConfig` for the exact syntax.

Then configure the model in Filament (Search → Searchable Models → Configure). Stored values for index name, searchable fields, and engine will take effect when this trait is used. If no config exists for the model, behavior is identical to Scout’s defaults.

Batch operations without indexing
---------------------------------

[](#batch-operations-without-indexing)

When you need to run many Eloquent operations (bulk updates, imports, etc.) without syncing each change to the search index, use Scout’s `withoutSyncingToSearch()` method. This avoids unnecessary index writes and improves performance.

Wrap your bulk logic in a closure:

```
use App\Models\Product;

Product::withoutSyncingToSearch(function () {
    Product::where('status', 'draft')->update(['status' => 'published']);
    // ... other bulk operations
});
```

After the batch is done, re-import the affected model so the index is up to date:

```
php artisan scout:import "App\Models\Product"
```

This pattern is controlled in your application code; the plugin does not add any global pause or toggle. See [Laravel Scout: Pausing Indexing](https://laravel.com/docs/11.x/scout#pausing-indexing).

Conditionally searchable records
--------------------------------

[](#conditionally-searchable-records)

To index only some records (e.g. only published posts), implement `shouldBeSearchable()` on your model. Scout calls this when syncing via `save`/`create` or when using the `searchable()` method on a query; if it returns `false`, the record is not added or updated in the index.

```
public function shouldBeSearchable(): bool
{
    return $this->is_published;
}
```

- This logic must live in your model; the plugin does not override or control it.
- When using Scout’s **database** engine, `shouldBeSearchable()` is not applied (all searchable data is in the database). For similar behavior, use [where clauses](https://laravel.com/docs/11.x/scout#where-clauses) in your search queries instead.
- See [Laravel Scout: Conditionally Searchable Model Instances](https://laravel.com/docs/11.x/scout#conditionally-searchable-model-instances).

Scout queue behavior
--------------------

[](#scout-queue-behavior)

Scout’s queue configuration is **global**, not per model.

- Set `SCOUT_QUEUE=true` in `.env` (or the `queue` option in `config/scout.php`) to queue index operations instead of running them synchronously.
- The queue connection and queue name are defined in `config/scout.php` and apply to all Scout indexing jobs.
- Per-model queue routing is not supported by Scout out of the box; it would require a custom job implementation that reads your own config. The plugin does not change Scout’s global queue behavior.
- See [Laravel Scout: Queueing](https://laravel.com/docs/11.x/scout#queueing).

Database engine search strategies
---------------------------------

[](#database-engine-search-strategies)

When using Scout’s **database** engine (`SCOUT_DRIVER=database`), you can control how each column is searched by adding PHP attributes to your model’s `toSearchableArray()` method:

- **`SearchUsingFullText`** – use MySQL/PostgreSQL full-text search for the listed columns (faster and more relevant for text). Requires a [full-text index](https://laravel.com/docs/11.x/migrations#available-index-types) on those columns in a migration.
- **`SearchUsingPrefix`** – use prefix-only matching (e.g. `term%`) for the listed columns instead of `%term%`. Helps performance on large tables.

Columns not covered by these attributes keep Scout’s default “where like” behavior. The plugin does not set or change these attributes; you implement them in your model.

Example:

```
use Laravel\Scout\Attributes\SearchUsingFullText;
use Laravel\Scout\Attributes\SearchUsingPrefix;

#[SearchUsingFullText(['title', 'description'])]
#[SearchUsingPrefix(['sku'])]
public function toSearchableArray(): array
{
    return [
        'title' => $this->title,
        'description' => $this->description,
        'sku' => $this->sku,
    ];
}
```

In a migration, add a full-text index for the columns you use with `SearchUsingFullText`:

```
$table->fullText(['title', 'description']);
```

These strategies apply only when the engine is database. See [Laravel Scout: Customizing Database Searching Strategies](https://laravel.com/docs/11.x/scout#customizing-database-searching-strategies).

Customizing Scout import queries
--------------------------------

[](#customizing-scout-import-queries)

Scout lets you customize how models are loaded during batch import and how the collection is prepared before indexing. Implement these methods on your model; the plugin does not override them.

**Modify the import query** (e.g. eager load relations to avoid N+1 during import):

```
use Illuminate\Database\Eloquent\Builder;

protected function makeAllSearchableUsing(Builder $query): Builder
{
    return $query->with(['category', 'tags']);
}
```

**Modify the collection before indexing** (e.g. load relations on the chunk):

```
use Illuminate\Database\Eloquent\Collection;

public function makeSearchableUsing(Collection $models): Collection
{
    return $models->load('author');
}
```

- Use these to eager load relationships so `toSearchableArray()` can use related data without extra queries.
- `makeAllSearchableUsing` is used when you run `scout:import` or `Model::makeAllSearchable()`; note that when the import is queued, relationships may not be restored in the job, so prefer `makeSearchableUsing` for per-chunk loading when using queues.
- See [Laravel Scout: Modifying the Import Query](https://laravel.com/docs/11.x/scout#modifying-the-import-query) and [Modifying Records Before Importing](https://laravel.com/docs/11.x/scout#modifying-records-before-importing).

Algolia user identification
---------------------------

[](#algolia-user-identification)

When using the Algolia engine, you can associate search requests with authenticated users for analytics and personalization. Set in your `.env`:

```
SCOUT_IDENTIFY=true
```

This tells Scout to pass the authenticated user’s primary identifier and the request IP to Algolia with each search request. The plugin does **not** automatically send or capture user data; enabling identification and what is sent remain under your application and Laravel Scout. See [Laravel Scout: Identifying Users](https://laravel.com/docs/11.x/scout#identifying-users).

Customizing the indexed model ID
--------------------------------

[](#customizing-the-indexed-model-id)

By default, Scout uses the model’s primary key as the unique ID stored in the index. You can override this with `getScoutKey()` and `getScoutKeyName()` on your model (e.g. to use UUIDs, emails, or external IDs). Some engines (e.g. Typesense) expect string IDs or specific key names.

```
public function getScoutKey()
{
    return $this->email;
}

public function getScoutKeyName()
{
    return 'email';
}
```

The plugin does not override these methods; implement them in your model when needed. See [Laravel Scout: Configuring the Model ID](https://laravel.com/docs/11.x/scout#configuring-the-model-id).

Passing engine-specific search options
--------------------------------------

[](#passing-engine-specific-search-options)

Some engines support passing extra parameters into the search request. For example, Typesense allows dynamic search parameters via `options()`:

```
Post::search('laravel')
    ->options([
        'query_by' => 'title, description',
        'filter_by' => 'published:=true',
    ])
    ->get();
```

Algolia and other engines may support similar options depending on their API. The plugin does not restrict or modify `options()`; advanced search behavior stays in your application code. See your engine’s documentation (e.g. [Typesense search parameters](https://typesense.org/docs/latest/api/search.html#search-parameters)).

Laravel Scout feature coverage
------------------------------

[](#laravel-scout-feature-coverage)

FeatureStatusIndex syncing (import, flush, refresh, sync settings)✅Runtime overrides (index name, fields, engine via trait)✅Typesense UI support &amp; safe indexed count✅Custom engines (safe handling, no UI break)✅Indexing control docs (pause, conditional, queue)✅Database engine docs (search strategies, full-text)✅Import customization docs (makeAllSearchableUsing, makeSearchableUsing)✅Algolia user identification docs✅Scout key override docs (getScoutKey, getScoutKeyName)✅Dynamic search options docs (options())✅The plugin does not override Scout core behavior. All engine-specific logic (identify, key, options) remains application-controlled.

Testing
-------

[](#testing)

The package uses [Pest](https://pestphp.com/) for PHPUnit-style tests. Run the test suite:

```
composer test
```

### Test coverage

[](#test-coverage)

- **Plugin**: ID, Filament contract, registration of resources and widgets (SearchableModelResource, SearchQueryLogResource, SynonymResource, IndexStatusWidget, PopularSearchesWidget).
- **Actions**: Import, Flush, Refresh, Sync Index Settings (labels, icons, confirmation).
- **Resources**: SearchableModelResource (navigation, `isSearchable`, Eloquent query), engine badges, SearchQueryLogResource, SynonymResource.
- **Widgets**: IndexStatusWidget (column span, stats), PopularSearchesWidget (data, logging toggle).
- **Services**: ScoutModelConfigService, ScoutIndexSettingsService, IndexedCountResolver (Algolia/Meilisearch/Typesense raw response parsing, unknown engine).
- **DTO &amp; traits**: ScoutModelConfigDTO (properties, readonly), UsesScoutManagerConfig / SearchableWithScoutManagerConfig (searchableAs, toSearchableArray, scoutQueueConnection, searchableUsing).
- **Settings &amp; models**: FilamentScoutManagerSettings, SearchQueryLog, Synonym.
- **Commands**: Install command (signature, handle).
- **Localization**: English and Arabic translation keys.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for recent updates.

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

[](#contributing)

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

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Muhammad-Nawlo](https://github.com/Muhammad-Nawlo)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE.md) for details.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance88

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.6% 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 ~1 days

Total

13

Last Release

77d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ddfb43f266d35c05d24a2550272455eab20fe1bdec1241b4ce3e78eddc95011?d=identicon)[Muhammad-Nawlo](/maintainers/Muhammad-Nawlo)

---

Top Contributors

[![Muhammad-Nawlo](https://avatars.githubusercontent.com/u/74303274?v=4)](https://github.com/Muhammad-Nawlo "Muhammad-Nawlo (48 commits)")[![nawlomuhammad](https://avatars.githubusercontent.com/u/226556641?v=4)](https://github.com/nawlomuhammad "nawlomuhammad (21 commits)")

---

Tags

searchlaravelindexfilamentfilament-pluginfilamentphpscoutMuhammad-Nawlofilament-scout-manager

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/muhammad-nawlo-filament-scout-manager/health.svg)

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

###  Alternatives

[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

397612.3k](/packages/jeroen-g-explorer)[kainiklas/filament-scout

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

3573.3k](/packages/kainiklas-filament-scout)[zing/laravel-scout-opensearch

Laravel Scout custom engine for OpenSearch

33340.2k](/packages/zing-laravel-scout-opensearch)[guava/filament-modal-relation-managers

Allows you to embed relation managers inside filament modals.

7565.0k4](/packages/guava-filament-modal-relation-managers)[codewithdennis/filament-price-filter

A simple and customizable price filter for FilamentPHP, allowing users to easily refine results based on specified price ranges.

163.2k](/packages/codewithdennis-filament-price-filter)[eightynine/filament-docs

Elegant documentation system for your Filament application with search, navigation, and markdown support

122.5k1](/packages/eightynine-filament-docs)

PHPackages © 2026

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