{"id":49411822,"url":"https://github.com/matheusmarnt/scoutify","last_synced_at":"2026-05-09T23:20:48.425Z","repository":{"id":354110109,"uuid":"1222054241","full_name":"matheusmarnt/scoutify","owner":"matheusmarnt","description":"⌘K global search modal for Laravel — multi-model Livewire UI powered by Scout.","archived":false,"fork":false,"pushed_at":"2026-04-30T17:14:22.000Z","size":1750,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-02T04:02:34.834Z","etag":null,"topics":["algolia","global-search","laravel","laravel-package","laravel-scout","livewire","meilisearch","pest","php","search","tailwindcss","typesense"],"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/matheusmarnt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"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":"matheusmarnt"}},"created_at":"2026-04-27T02:07:15.000Z","updated_at":"2026-04-30T17:14:17.000Z","dependencies_parsed_at":"2026-05-01T03:00:42.085Z","dependency_job_id":null,"html_url":"https://github.com/matheusmarnt/scoutify","commit_stats":null,"previous_names":["matheusmarnt/scoutify"],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/matheusmarnt/scoutify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheusmarnt%2Fscoutify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheusmarnt%2Fscoutify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheusmarnt%2Fscoutify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheusmarnt%2Fscoutify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matheusmarnt","download_url":"https://codeload.github.com/matheusmarnt/scoutify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheusmarnt%2Fscoutify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32719572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T00:29:05.620Z","status":"online","status_checked_at":"2026-05-07T02:00:07.170Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["algolia","global-search","laravel","laravel-package","laravel-scout","livewire","meilisearch","pest","php","search","tailwindcss","typesense"],"created_at":"2026-04-29T01:03:13.593Z","updated_at":"2026-05-07T02:02:34.516Z","avatar_url":"https://github.com/matheusmarnt.png","language":"PHP","funding_links":["https://github.com/sponsors/matheusmarnt"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"art/scoutify.png\" alt=\"Scoutify\" width=\"750\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://packagist.org/packages/matheusmarnt/scoutify\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/matheusmarnt/scoutify.svg?style=flat-square\" alt=\"Latest Version on Packagist\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/matheusmarnt/scoutify/actions?query=workflow%3Atests+branch%3Amain\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/matheusmarnt/scoutify/tests.yml?branch=main\u0026label=tests\u0026style=flat-square\" alt=\"Tests\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/matheusmarnt/scoutify/actions?query=workflow%3Apint+branch%3Amain\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/matheusmarnt/scoutify/pint.yml?branch=main\u0026label=code+style\u0026style=flat-square\" alt=\"Code Style\" /\u003e\u003c/a\u003e\n    \u003ca href=\"LICENSE.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-brightgreen?style=flat-square\" alt=\"License\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://laravel.com\"\u003e\u003cimg src=\"https://img.shields.io/badge/Laravel-11%7C12-FF2D20?style=flat-square\u0026logo=laravel\u0026logoColor=white\" alt=\"Laravel\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://livewire.laravel.com\"\u003e\u003cimg src=\"https://img.shields.io/badge/Livewire-3%7C4-FB70A9?style=flat-square\" alt=\"Livewire\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://laravel.com/docs/scout\"\u003e\u003cimg src=\"https://img.shields.io/badge/Scout-11-FF2D20?style=flat-square\u0026logo=laravel\u0026logoColor=white\" alt=\"Scout\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Scoutify\n\n⌘K global search modal for Laravel — multi-model Livewire UI powered by Scout.\n\nDrops a production-ready ⌘K search experience into any Laravel application. Register Eloquent models, choose a Scout driver, and ship a keyboard-triggered modal that queries multiple model types simultaneously, groups results by type, and persists recent search history to session.\n\n## Features\n\n- **Livewire modal** — keyboard-triggered (`⌘K` / `Ctrl+K`) global search dialog\n- **Zero-config discovery** — models under `app/Models/` using `Searchable` are auto-detected at boot\n- **Grouped results** — results organised by model type with section headers and color tokens\n- **Multiple drivers** — Meilisearch, Algolia, Typesense, or Database\n- **Query hook** — per-model `globalSearchBuilder()` for custom filters, scopes, or infix matching\n- **Recent searches** — configurable history, persisted to session\n- **i18n** — ships with `pt_BR`, `en`, and `es` translations\n- **Dark mode** — full dark mode support out of the box\n- **WCAG AA** — accessible markup with focus management and keyboard navigation\n- **Tailwind v4** — utility classes inlined, override via config\n\n## Quick Start\n\n```bash\ncomposer require matheusmarnt/scoutify\nphp artisan scoutify:install\n```\n\nThis will:\n1. Prompt for a Scout driver (`meilisearch`, `algolia`, or `typesense`)\n2. Install the driver's Composer packages\n3. Publish `config/scoutify.php`\n4. Set `SCOUT_DRIVER` in `.env`\n\n## Registering Models\n\nMake your Eloquent models globally searchable:\n\n```bash\nphp artisan scoutify:searchable\n```\n\nThe command discovers Eloquent models under `app/Models/`, prompts you to pick which to register (or pass `--all`), and **automatically edits each chosen model file** to:\n\n1. Import `Matheusmarnt\\Scoutify\\Concerns\\Searchable` and `Matheusmarnt\\Scoutify\\Contracts\\GloballySearchable`\n2. Add `implements GloballySearchable` to the class declaration\n3. Insert `use Searchable;` as the first statement in the class body\n\nThe command then rebuilds the type manifest so models appear in the UI immediately.\n\nThe `Searchable` trait provides sensible defaults for every interface method. Override as needed:\n\n```php\npublic function globalSearchTitle(): string      { return $this-\u003etitle; }\npublic function globalSearchSubtitle(): ?string  { return $this-\u003eauthor; }\npublic function globalSearchUrl(): string        { return route('articles.show', $this); }\n\npublic static function globalSearchGroup(): string  { return 'Articles'; }\npublic static function globalSearchLabel(): string  { return 'Articles'; }  // UI chip label\npublic static function globalSearchIcon(): string   { return 'heroicon-o-document-text'; }\npublic static function globalSearchColor(): string  { return 'blue'; }\n```\n\nUse `--dry-run` to preview edits without touching files:\n\n```bash\nphp artisan scoutify:searchable --dry-run\n```\n\nThen import your models into the Scout index:\n\n```bash\nphp artisan scoutify:import\n```\n\nAdd to your layout:\n\n```blade\n\u003cx-scoutify::gs.trigger /\u003e\n\u003clivewire:scoutify::modal /\u003e\n```\n\n## Customizing the Scout Query\n\nOverride `globalSearchBuilder()` on any model to apply custom filters, scopes, or driver-specific options:\n\n```php\nuse Laravel\\Scout\\Builder;\n\npublic function globalSearchBuilder(Builder $builder, string $query): Builder\n{\n    return $builder-\u003ewhere('published', true);\n}\n```\n\n\u003e **Meilisearch note:** Meilisearch uses word-boundary prefix search. Substrings that are not word-prefixes (e.g. `\"ano\"` inside `\"Mariano\"`) return no results. If you need substring (infix) matching, override `globalSearchBuilder()` to configure Meilisearch's `attributesToSearchOn` or switch to the `database` driver which uses `LIKE`-based search.\n\n## Opening the Modal Programmatically\n\nAny element can open Scoutify without the official trigger component.\n\n**Alpine (recommended):**\n```html\n\u003cbutton x-data @click=\"$dispatch('scoutify:open')\"\u003eSearch\u003c/button\u003e\n```\n\n**Plain JS / any context:**\n```js\nwindow.dispatchEvent(new CustomEvent('scoutify:open'))\n```\n\n**Inside a Livewire component:**\n```html\n\u003cbutton wire:click=\"$dispatchTo('scoutify::modal', 'scoutify:open')\"\u003eSearch\u003c/button\u003e\n```\n\n\u003e **Do not use** `wire:click=\"$dispatch('scoutify:open')\"` on plain Blade elements — outside a Livewire component tree, Livewire.js never initialises those directives.\n\n## Commands\n\n| Command | Description |\n|---|---|\n| `scoutify:install` | Install driver packages, publish config, configure backend |\n| `scoutify:doctor` | Verify driver config and backend connectivity |\n| `scoutify:searchable` | Register models as globally searchable and rebuild manifest |\n| `scoutify:rebuild` | Rebuild the type manifest from `app/Models/` |\n| `scoutify:import` | Import registered models into Scout index |\n| `scoutify:flush` | Flush registered models from Scout index |\n| `scoutify:sync` | Flush then re-import |\n\n## Documentation\n\n- [Installation guide](docs/installation.md) — step-by-step setup, model registration, Tailwind config, customization\n- [Production deployment](docs/production.md) — per-driver production configuration (Meilisearch, Algolia, Typesense, Database)\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## License\n\nMIT — see [LICENSE](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatheusmarnt%2Fscoutify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatheusmarnt%2Fscoutify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatheusmarnt%2Fscoutify/lists"}