Laravel and Elasticsearch


June 16th, 2016

Laravel and Elasticsearch

Elasticsearch allows you to search & analyze data in real time. Even though it’s extremely powerful working with delta’s and querying data is not that simple.

If you are using Laravel here is a list of packages and tutorials to help you easily integrate this into your app.

Laravel Elasticsearch Packages

Below are three packages that you can install via Composer and instantly add to any existing app:


Plastic is an Elasticsearch ODM and mapper for Laravel. It renders the developer experience more enjoyable while using Elasticsearch, by providing a fluent syntax for mapping, querying, and storing eloquent models.

Elasticsearch Eloquent

This package allows you to interact with Elasticsearch as you interact with Eloquent models in Laravel.


A lightweight package built on top of the Elasticsearch PHP client. Its main goal is to allow for easy structuring of queries and indices in your application.


Elasticquent makes working with Elasticsearch and Eloquent models easier by mapping them to Elasticsearch types. You can use the default settings or define how Elasticsearch should index and search your Eloquent models right in the model.

Spatie Searchindex

This is an opinionated Laravel 5.1 package to store and retrieve objects from a search index. Currently, Elasticsearch and Algolia are supported.

Laravel Elasticsearch Tutorials

Want to learn more about Elasticsearch? The following are great tutorials to get you started:

Install Elasticsearch on Laravel Homestead

If you are going to use Elasticsearch it’s a good idea to be able to test it locally. Mirza Pasic put together this guide to help you set it up on Homestead.

Integrating Elasticsearch with Your Laravel app

Tony Messias has a complete tutorial covering Elasticsearch plus a sample integration.

Discovering ElasticSearch

A video presentation from 2014 at Laracon EU by Ben Corlett.

Filed in:

Eric L. Barnes

Eric is the creator of Laravel News and has been covering Laravel since 2012.