laravel/scout
Laravel Scout adds driver-based full-text search to Eloquent models, automatically syncing model changes to search indexes. Supports Algolia, Meilisearch, and Typesense, with easy configuration via Laravel’s Scout integration.
searchable trait) leverages Laravel’s event system, ensuring real-time index updates with minimal manual intervention.where, orderBy, cursor), maintaining consistency with Laravel’s query conventions.where('category', 'products')), making it versatile for complex search use cases.scout:import). No low-level infrastructure changes are required.scout:queue-import) optimizes large dataset imports, reducing downtime during migrations.toSearchableArray, afterRawSearch) for fine-grained control over search behavior, accommodating edge cases.scout:flush) can disrupt production if not handled carefully. Automated cleanup strategies (e.g., soft deletes) may need customization.toSearchableArray method need heavy customization for complex model relationships?toSearchableArray method for complex model structures (e.g., polymorphic relationships).searchableSync/unsearchableSync for controlled index management.toSearchableArray.Builder extends Eloquent’s query builder but lacks some advanced features (e.g., raw SQL in whereRaw). Workarounds may be needed for legacy queries.collection driver), but external caching layers (e.g., Redis) may need tuning for search results.FakeDriver)..env (e.g., SCOUT_DRIVER=meilisearch).searchableAs).Searchable trait to models and implement toSearchableArray.SCOUT_QUEUE=redis).Builder methods (e.g., Model::search('query')->get()).afterRawSearch callbacks for post-processing (e.g., sorting, highlighting).toSearchableArray to minimize payload size (e.g., exclude unnecessary fields).searchableAttributes).searchableAttributes) may need adjustments as data schemas evolve. Document these in a runbook.toSearchableArray or afterRawSearch may introduce technical debt. Refactor shared logic into base model traits or services.toSearchableArray. Scout’s logs and driver-specific errors (e.g., Meilisearch’s HTTP 400s) are key debugging tools.scout:flush cautiously in production; prefer scout:force for targeted index rebuilds.php artisan queue:retry).toSearchableArray to reduce payload size and improve indexing speed.typoTolerance, Meilisearch’s rankingRules) to balance relevance and performance.scout:queue-import) mitigate sync bottlenecks during high-write periods.How can I help you explore Laravel packages today?