What is Laravel Scout for full-text search?
Answer
Laravel Scout is a driver-based full-text search package for Eloquent models. Install: composer require laravel/scout. Add the Searchable trait to a model and define toSearchableArray() to specify searchable fields. Scout syncs model data to the search index automatically via Eloquent model events. Drivers: Algolia (cloud, most features), Meilisearch (self-hosted, fast), Typesense, and database (built-in using LIKE — no external service, good for small datasets). Search: Post::search("Laravel best practices")->get(). Combine with Eloquent constraints: Post::search($query)->where("published", true)->paginate(10). Index all existing records: php artisan scout:import "App\Models\Post". Scout removes the complexity of integrating search engines directly, providing a clean, unified API.
Previous
What are Eloquent eager loading with constraints?
Next
What is deferred loading with lazy collections in Laravel?