Algolia and Laravel Scout

Introducing Laravel Scout

With the addition of Laravel Scout, Laravel has provided an easy interface into Algolia’s API Client, greatly simplifying your use of Algolia within the framework.

Though Scout is designed to work with any engine, it was actually built with Algolia in mind. At the time of this writing, Algolia is the only search engine that Laravel officially supports.

For these reasons, we encourage you to start using Scout for all of your Algolia data indexing and synchronization. As for building UIs, we discuss your options below.

If you want see some code, we built an example project showcasing some of the feature of Algolia and Laravel Scout:

Regarding documentation

Laravel has written excellent online documentation to go along with its release of Scout. They go into great detail on how to use the Scout interface. Additionally, there are Laracasts that can help you get started with Scout and Algolia. These resources should be sufficient not only to help you get started, but to implement Algolia in the best possible way within the Laravel framework.

One of our goals here is to complement Laravel’s documentation by anticipating questions you might have after reading Laravel’s documentation. We touch on some of the same material, adding our point of view to such subjects as installation, managing indices, and others.

Of equal interest, we show you how to extend Scout with callbacks and extended devices, and how to use the Macros we have written to simplify your code. We also provide tutorials that showcase special use cases, like geo-awareness.

The client side of Laravel

Putting aside data indexing operations, which are done on your servers, we recommend that your search operations be done directly on the client-side, using JavaScript. This will significantly improve your search response times, and reduce the load and traffic on your servers.

Both Laravel and Algolia make working with JavaScript easy, with or without a JS framework. We will show you how to quickly build rich UIs, by taking you through our instant search package, which is a full UI solution with versions for Vue JS, React JS, and simple native JS. Once plugged in, instant search will give your website immediate access to such features (or widgets) as formatted results, filtering & faceting, pagination, infinite scrolling, and many other UI components.

Looking for the legacy package?

Before Scout came out, we had built our own Laravel integration. However, given the benefits of Scout, and its compatibility with Algolia, we really encourage you to switch over to Scout.

If you are still using our previous package, you can access its documentation here in the Readme of the package.