Friday, August 19, 2016

Search a full text using scout in Laravel 5.3

Search a full text using scout in Laravel 5.3:

In Laravel 5.3 we can search a full text using scout.

For this we have to import it in that model.

php artisan scout:import App\\Post
After that we can use it in model like this.

Post::search('Alice')->get();
Also we can use it in pagination.

Post::search('Alice')->paginate()
Also, we can use in simple where clauses.

Post::search(‘Alice’)—>where('acount_id', '>', 1)->paginate()
Thanks







No comments:

Post a Comment