Integrations / Frameworks / Laravel / Quick Start

Quick Start

Quick start

First, let’s import your data into Algolia. To import your data, we will use the scout:import Artisan command:

$
php artisan scout:import

Next, open the routes/web.php file and the following route to the bottom of the file:

1
2
3
4
5
6
7
Route::get('search', function() {
    $query = ''; // <-- Change the query for testing.

    $articles = App\Article::search($query)->get();

    return $articles;
});

Now, if you hit the /search route in your web browser, you should see all articles that match the given $query.

This is just the beginning. In this quick start, you’ve seen the very basics, but there are so many more exciting things to learn. Keep reading through the documentation and dig deeper into the powerful features available to you in Scout Extended.

Did you find this page helpful?