{"id":37002302,"url":"https://github.com/kainiklas/filament-scout","last_synced_at":"2026-01-14T00:28:26.213Z","repository":{"id":212436212,"uuid":"731024761","full_name":"kainiklas/filament-scout","owner":"kainiklas","description":"Filament Plugin to integrate Laravel Scout into Global Search, Table Search and Select field component","archived":false,"fork":false,"pushed_at":"2025-11-13T14:41:41.000Z","size":338,"stargazers_count":29,"open_issues_count":3,"forks_count":12,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-13T15:19:08.771Z","etag":null,"topics":["filament","filament-plugin","filamentphp","filamentplugin","laravel","laravel-scout","meilisearch","meilisearch-php","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kainiklas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"kainiklas"}},"created_at":"2023-12-13T07:38:14.000Z","updated_at":"2025-11-13T14:41:45.000Z","dependencies_parsed_at":"2025-09-17T21:16:02.672Z","dependency_job_id":"92ae39c5-170a-46bc-bc4e-7853988073a7","html_url":"https://github.com/kainiklas/filament-scout","commit_stats":null,"previous_names":["kainiklas/filament-scout"],"tags_count":9,"template":false,"template_full_name":"filamentphp/plugin-skeleton","purl":"pkg:github/kainiklas/filament-scout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kainiklas%2Ffilament-scout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kainiklas%2Ffilament-scout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kainiklas%2Ffilament-scout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kainiklas%2Ffilament-scout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kainiklas","download_url":"https://codeload.github.com/kainiklas/filament-scout/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kainiklas%2Ffilament-scout/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406485,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filament","filament-plugin","filamentphp","filamentplugin","laravel","laravel-scout","meilisearch","meilisearch-php","php"],"created_at":"2026-01-14T00:28:25.533Z","updated_at":"2026-01-14T00:28:26.190Z","avatar_url":"https://github.com/kainiklas.png","language":"PHP","funding_links":["https://github.com/sponsors/kainiklas"],"categories":[],"sub_categories":[],"readme":"# Filament Scout Plugin\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/kainiklas/filament-scout.svg?style=flat-square)](https://packagist.org/packages/kainiklas/filament-scout)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/kainiklas/filament-scout/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/kainiklas/filament-scout/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/kainiklas/filament-scout/fix-php-code-styling.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/kainiklas/filament-scout/actions?query=workflow%3A\"Fix+PHP+code+styling\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/kainiklas/filament-scout.svg?style=flat-square)](https://packagist.org/packages/kainiklas/filament-scout)\n\n![Filament Scout Plugin](https://raw.githubusercontent.com/kainiklas/filament-scout/main/art/filament-scout.jpeg)\n\n\u003c!-- https://banners.beyondco.de/Filament%20Scout.jpeg?theme=light\u0026packageManager=composer+require\u0026packageName=kainiklas%2Ffilament-scout\u0026pattern=plus\u0026style=style_1\u0026description=Laravel+Scout+for+Global+Search%2C+Table+Search+and+Select+Field\u0026md=1\u0026showWatermark=1\u0026fontSize=150px\u0026images=search-circle --\u003e\n\nPlugin 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.\n\n## Pre-Requesites\n\n- [Laravel Scout](https://laravel.com/docs/12.x/scout): Install and configure Laravel Scout as described in the Laravel Docs.\n\n## Supported Filament Versions\n\n| Filament Version | Filament Scout Version |\n| --- | --- |\n| 3.x | 0.x |\n| 4.x | 1.x | \n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require kainiklas/filament-scout\n```\n\n## Table Search\n\nTo 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`:\n\n```php\nuse Kainiklas\\FilamentScout\\Traits\\InteractsWithScout;\n\nclass ListMyResources extends ListRecords\n{\n    use InteractsWithScout;\n}\n```\n\nThe 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). \nMaking each column searchable is not required anymore, as the content of what is searchable is defined within scout.\n\n### Increase the number of search results\n\nDepending on the scout engine you may have limitations on how many search results you get back.\nThis can be adjusted in two places:\n\n#### 1. Search Limit\n\nAdd the following `env` variable to adjust the limit of search results:\n\n```\nSCOUT_SEARCH_LIMIT=100\n```\n\n`100` is the default value within this pagacke.\nFor example meilisearch has a default limit of `20`.\n\n#### 2. Index Settings (Example for meilisearch)\n\nWithin meilisearch there is a default limit of `1000` total hits which is also the upper bound for the search limit.\nThat means if you want to have more than `1000` search results, you need to adapt both: the search limit and the index settings.\nThe index settings can be adjusted within `config\\scout.php`:\n\n```php\n'index-settings' =\u003e [\n  MyClass::class =\u003e [\n    'pagination' =\u003e [\n      'maxTotalHits' =\u003e 10000\n    ],\n  ],\n],\n```\n\nThen run the following command to sync the settings: `php artisan scout:sync-index-settings`\n\n\n## Global Search\n\n1. Check how to enable [Global Search in the Filament Documentation](https://filamentphp.com/docs/4.x/resources/global-search). \n   - 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). \n   - (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).\n\n```php\nclass ContractResource extends Resource\n{\n    // required to enable global search\n    protected static ?string $recordTitleAttribute = 'name';\n\n    // optional: details\n    public static function getGlobalSearchResultDetails(Model $record): array\n    {\n        return [\n            'Category' =\u003e $record-\u003ecategory-\u003ename,\n        ];\n    }\n}\n```\n\n2. Add the Plugin `FilamentScoutPlugin` to your panel configuration, e.g., in `app\\Providers\\Filament\\AdminPanelProvider.php`.\n\n```php\nuse Kainiklas\\FilamentScout\\FilamentScoutPlugin;\n\nclass AdminPanelProvider extends PanelProvider\n{\n    public function panel(Panel $panel): Panel\n    {\n        return $panel\n            -\u003eplugins([\n                FilamentScoutPlugin::make()\n            ]);\n    }\n}\n```\n\n### Meilisearch\n\nIf you are using [Meilisearch](https://www.meilisearch.com/), you can activate meilisearch specific features (search context highlighting):\n\n1. Configure the plugin.\n\n```php\nuse Kainiklas\\FilamentScout\\FilamentScoutPlugin;\n\nclass AdminPanelProvider extends PanelProvider\n{\n    public function panel(Panel $panel): Panel\n    {\n        return $panel\n            -\u003eplugins([\n                FilamentScoutPlugin::make()\n                    -\u003euseMeilisearch() // enables meilisearch specific features\n            ]);\n    }\n}\n```\n\n2. (Optional) Implement/ Adapt `getGlobalSearchResultDetails()` in your Resource:\n\n```php\npublic static function getGlobalSearchResultDetails(Model $record): array\n    {\n        // change the filament default implementation from this\n        // return [\n        //     'AttributeTitle' =\u003e $record-\u003eattribute_name\n        // ];\n        \n        // to this\n        return [\n            'scout_attribute_name' =\u003e \"AttributeTitle\"\n        ];\n    }\n```\n\n## Select Form Field\n\nTo enable scout search in your select form fields use the provided `ScoutSelect` component:\n\n```php\nuse Kainiklas\\FilamentScout\\Forms\\Components\\ScoutSelect;\n \nScoutSelect::make('company_id')\n    -\u003esearchable()\n    -\u003erelationship('company', 'name')\n    -\u003euseScout() // must be called after relationship()\n```\n\nTechnically, the `ScoutSelect` component inherits from `Filament\\Forms\\Components\\Select`. The `useScout()` method sets a new  `getSearchResultsUsing()` closure which uses scout.\n\n__Important__: The `useScout()` method needs to be called *after* the relationship method. Otherwise it is overriden by the `relationship()` method.\n\n*Hint*: Only values which are accessible and defined by scout are searchable.\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Kai Niklas](https://github.com/kainiklas)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkainiklas%2Ffilament-scout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkainiklas%2Ffilament-scout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkainiklas%2Ffilament-scout/lists"}