Laravel scout
Skill fusengine/agents/plugins/laravel-expert/skills/laravel-scout
Implement full-text search with Laravel Scout. Use when adding search to Eloquent models with Meilisearch, Algolia, or database driver.From its SKILL.md
npx -y skills add fusengine/agents --skill laravel-scoutAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 22 stars22 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.1 KB, 702 tokens by cl100k_base, as published. Nobody here has run it
Laravel Scout
Agent Workflow (MANDATORY)
Before ANY implementation, use TeamCreate to spawn 3 agents:
- fuse-ai-pilot:explore-codebase - Analyze existing model and search patterns
- fuse-ai-pilot:research-expert - Verify Scout docs via Context7
- mcp__context7__query-docs - Check search and indexing patterns
After implementation, run fuse-ai-pilot:sniper for validation.
Overview
| Component | Purpose |
|---|---|
| Searchable Trait | Makes Eloquent models searchable |
| Search Drivers | Meilisearch, Algolia, database, collection |
| Indexing | Automatic sync on model changes |
| Search Builder | Fluent search API with filters |
Decision Guide: Search Driver
Which driver?
├── Production (recommended) → Meilisearch (fast, self-hosted, free)
├── Managed service → Algolia (hosted, pay per search)
├── Small dataset → database (no extra infra)
└── Testing → collection (in-memory, no engine)
Quick Setup
composer require laravel/scout
composer require meilisearch/meilisearch-php http-interop/http-factory-guzzle
SCOUT_DRIVER=meilisearch
MEILISEARCH_HOST=http://127.0.0.1:7700
MEILISEARCH_KEY=masterKey
$results = Article::search('laravel tutorial')->paginate(15);
Critical Rules
- Use
toSearchableArray()to control indexed data - Queue indexing with
SCOUT_QUEUE=truefor performance - Use
searchable()for bulk import after setup - Pause indexing during seeders with
Scout::withoutSyncing()
Reference Guide
| Need | Reference |
|---|---|
| Searchable trait, indexing, conditions | searchable.md |
| Driver setup, Meilisearch, Algolia | drivers.md |
Best Practices
DO
- Use Meilisearch for production (fast, typo-tolerant)
- Queue indexing operations (
SCOUT_QUEUE=true) - Limit indexed fields with
toSearchableArray()
DON'T
- Index sensitive data (passwords, tokens)
- Forget to import existing records after setup
- Use collection driver in production
Laravel 13 Notes
Vector search natif pgvector
Pour la recherche sémantique (embeddings) sur PostgreSQL, Laravel 13 expose Schema::ensureVectorExtensionExists() et whereVectorSimilarTo() via la skill dédiée [[laravel-vector-search]]. Scout reste pertinent pour le full-text (Meilisearch/Algolia) ; pour la similarité vectorielle, utiliser pgvector directement sans driver Scout.
// Hybride : Scout pour full-text, pgvector pour similarité
$keyword = Post::search($query)->get();
$semantic = Post::whereVectorSimilarTo('embedding', $embedding, limit: 10)->get();
What ships with it: 2 files
3.8 KB alongside SKILL.md
references/
- drivers.md1.9 KB
- searchable.md1.9 KB