Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Scout Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Laravel Scout is a driver-based Laravel package that adds full-text search to your Eloquent models. After installation and configuration, Scout automatically keeps your search indexes in sync with model changes, letting you focus on building search experiences instead of wiring integrations.

It supports multiple search backends via interchangeable drivers, including Algolia, Meilisearch, and Typesense, making it easy to choose the engine that fits your app and scale.

  • Driver-based search integration with swappable engines
  • Automatic index syncing for create/update/delete model events
  • Works seamlessly with Eloquent for model-centric search
  • Supports Algolia, Meilisearch, and Typesense out of the box
  • Simple setup with official Laravel documentation
Frequently asked questions about Scout
How do I install Laravel Scout for full-text search in my Laravel app?
Run `composer require laravel/scout` to install the package. Then configure your preferred driver (Algolia, Meilisearch, or Typesense) in your `.env` file. Finally, mark your Eloquent model as searchable by implementing the `Searchable` trait and defining `toSearchableArray()`.
Which Laravel versions support Laravel Scout?
Laravel Scout is officially maintained for Laravel 10.x and 11.x. Check the [Laravel Scout GitHub](https://github.com/laravel/scout) for version-specific compatibility details, as older Laravel versions may require older Scout releases.
Can I use Laravel Scout with self-hosted search engines like Meilisearch or Typesense?
Yes, Scout supports Meilisearch and Typesense as self-hosted alternatives to Algolia. Configure your `.env` file with the appropriate driver settings, and Scout will handle the rest. Each driver has its own query syntax, so test thoroughly before production.
How does Scout handle model updates and deletions for search indexes?
Scout uses Eloquent model observers to automatically sync changes (create, update, delete) to your search index. For large datasets, you can use `scout:queue` to process updates asynchronously via Laravel queues, reducing latency.
What’s the best way to reindex all models in Laravel Scout?
Use the `scout:flush` command to clear the existing index, then run `scout:index` to rebuild it. For large datasets, consider batching the process or running it during low-traffic periods to avoid performance issues.
Does Laravel Scout support fuzzy or typo-tolerant search?
Fuzzy search depends on your chosen driver. Algolia and Typesense offer built-in typo tolerance, while Meilisearch requires explicit configuration. Scout abstracts these differences, so check your driver’s documentation for specific syntax.
How do I paginate search results in Laravel Scout?
Use Scout’s `cursor()` method for cursor-based pagination or `simplePaginate()` for traditional pagination. Algolia and Typesense handle cursor pagination natively, while Meilisearch may require additional query parameters for efficient pagination.
What are the performance implications of using Scout with Algolia vs. self-hosted options?
Algolia offers low-latency searches but may incur costs at scale. Self-hosted options like Meilisearch or Typesense reduce costs but require infrastructure management. Test query performance (QPS) and indexing speed with your chosen driver before committing to production.
Can I customize how Scout indexes or searches my Eloquent models?
Yes, override the `toSearchableArray()` method to control indexed attributes or use callbacks like `afterRawSearch()` to modify search results. Scout also supports `makeAllSearchableUsing()` for bulk indexing logic.
What alternatives exist to Laravel Scout for full-text search in Laravel?
Alternatives include Laravel’s built-in database full-text search (PostgreSQL/MySQL), third-party packages like `spatie/laravel-searchable`, or standalone solutions like Elasticsearch with custom integrations. Scout stands out for its driver-based simplicity and seamless Eloquent integration.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport