Laravel Scout is a driver based full-text search for Eloquent that is going to be available when Laravel 5.3 launches.
The driver is not officially released yet, however, the repository is now live and available for those that want to play with more engines.
For those not familiar with Scout it is an optional package that makes full-text searching simple.
Scout works by implementing a “Searchable” trait with your existing models. Then it’s just a matter of syncing the data with the search service like this:
php artisan scout:import App\\Post
After that you can search your models with:
You can even paginate:
And it even includes simple where clauses:
Post::search(‘Alice’)—>where('acount_id', '>', 1)->paginate()
The repository has already had a few pull requests for adding additional search engines and Taylor is recommending developers create their own packages like what is being done with Laravel Notifications.
Once 5.3 is official the documentation for Scout will be available and it’ll be ready for all.Filed in: Laravel Packages / Scout
Join 31,000+ others and never miss out on new tips, tutorials, and more.
- Senior Laravel Developer
- Senior Full-Stack Engineer
[REMOTE: USA Only] All Other Applications Will be Rejected Immediately"
- Senior Full Stack PHP Developer
Motto Design Studio
- Software Engineer
Remote, USA Only
- Lead Backend PHP Developer
ABOUT YOU GmbH
How to use WordPress as a backend for a Laravel Application
Last week I relaunched Laravel News, and the new site is running on Laravel with WordPress as the backend. I’ve been…
A Quick Guide to Choosing Tools (Sponsor)
What separates the wrong analytics tool from the right one? It’s easy enough to figure out — if you understand…