PHPackages                             shift31/laravel-elasticsearch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. shift31/laravel-elasticsearch

ActiveLibrary[API Development](/categories/api)

shift31/laravel-elasticsearch
=============================

A Laravel Service Provider for the Elasticsearch API client

v4.5.1(9y ago)201369.7k↑33.3%37[3 issues](https://github.com/shift31/laravel-elasticsearch/issues)1PHPPHP &gt;=5.6

Since May 15Pushed 8y ago11 watchersCompare

[ Source](https://github.com/shift31/laravel-elasticsearch)[ Packagist](https://packagist.org/packages/shift31/laravel-elasticsearch)[ RSS](/packages/shift31-laravel-elasticsearch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (35)Used By (1)

Laravel Elasticsearch Service Provider (4.5.0)
==============================================

[](#laravel-elasticsearch-service-provider--450)

[![Latest Stable Version](https://camo.githubusercontent.com/d4033f6468b331c73b4ab92dadbbd6e8d520905972c4a5042dbf2932dc45567b/68747470733a2f2f706f7365722e707567782e6f72672f736869667433312f6c61726176656c2d656c61737469637365617263682f762f737461626c65)](https://packagist.org/packages/shift31/laravel-elasticsearch)[![Total Downloads](https://camo.githubusercontent.com/edd1ad87a52ca767b6a7461b33e6d0251b3e81b8eae5092fc21937ec56f56a70/68747470733a2f2f706f7365722e707567782e6f72672f736869667433312f6c61726176656c2d656c61737469637365617263682f646f776e6c6f616473)](https://packagist.org/packages/shift31/laravel-elasticsearch)[![Build Status](https://camo.githubusercontent.com/6f277e3af53ac6951c2f62111e3d83ed3ab09f8cc4e0107331884c510c1b85a5/68747470733a2f2f7472617669732d63692e6f72672f736869667433312f6c61726176656c2d656c61737469637365617263682e7376673f6272616e63683d342e35)](https://travis-ci.org/shift31/laravel-elasticsearch)[![Coverage Status](https://camo.githubusercontent.com/fe8adb1016989398f38b5fd1cf9800cdf4220eedbf79a1e060e724295e166da5/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f736869667433312f6c61726176656c2d656c61737469637365617263682f62616467652e7376673f6272616e63683d342e35)](https://coveralls.io/github/shift31/laravel-elasticsearch?branch=master)[![License](https://camo.githubusercontent.com/ea40b74341e9a7a8049774237a749395651b48740c8a0a72375935a9472fd89d/68747470733a2f2f706f7365722e707567782e6f72672f736869667433312f6c61726176656c2d656c61737469637365617263682f6c6963656e7365)](https://packagist.org/packages/shift31/laravel-elasticsearch)

This is a Laravel (4.2) Service Provider for the [official Elasticsearch low-level client](http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/5.0/index.html).

Version Matrix
--------------

[](#version-matrix)

Since there are breaking changes in Elasticsearch versions, your version of Elasticsearch must match the version of this library, which matches the version of the Elasticsearch low-level client.

Shift31/laravel-elasticsearchElasticsearchLaravel0.4&lt;= 0.90.\*4.21.0, 2.0&gt;= 1.04.x, 5.x4.0&lt;= 0.90.\*4.24.1&gt;= 1.0 &lt;= 2.04.24.2&gt;= 2.0 &lt;= 5.04.24.5&gt;= 5.04.25.0&lt;= 0.90.\*5.x5.1&gt;= 1.0 &lt;= 2.05.x5.2&gt;= 2.0 &lt;= 5.05.x5.5&gt;= 5.05.xAttention: Until we launch new versions please keep using old stable versions (which are created as a branch) and don't use dev-master branch!

Usage
-----

[](#usage)

1. Run `composer require shift31/laravel-elasticsearch:~4.5.0`
2. Publish config file

Laravel artisan command

```
$ php artisan config:publish shift31/laravel-elasticsearch

```

You can always read config parameters with:

```
\Config::get('shift31::elasticsearch');
```

Note: The keys of this array should be named according the parameters supported by [Elasticsearch\\ClientBuilder](https://github.com/elastic/elasticsearch-php/blob/5.0/src/Elasticsearch/ClientBuilder.php#L119).

3. In the `'providers'` array in app/config/app.php, add `'Shift31\LaravelElasticsearch\ElasticsearchServiceProvider'`.
4. Use the `Es` facade to access any method from the `Elasticsearch\Client` class, for example:

```
$searchParams['index'] = 'your_index';
$searchParams['size'] = 50;
$searchParams['body']['query']['query_string']['query'] = 'foofield:barstring';
$result = Es::search($searchParams);
```

Default Configuration
---------------------

[](#default-configuration)

If you return an empty array in the config file, Service provider [merges default config with custom config variables](src/Shift31/LaravelElasticsearch/ElasticsearchServiceProvider.php). For custom config file question please see [this](https://www.elastic.co/guide/en/elasticsearch/client/php-api/5.0/_configuration.html#_building_the_client_from_a_configuration_hash) elastic search configuration page.

[Default config file](src/config/elasticsearch.php) which is publishing by artisan command.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md).

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 67.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~31 days

Recently: every ~0 days

Total

34

Last Release

3361d ago

Major Versions

1.3.4 → 2.02016-07-29

0.4.1 → 2.0.22016-08-05

2.0.4 → v4.0.02017-02-27

2.0.5 → 4.0.x-dev2017-03-05

PHP version history (6 changes)v1.1PHP &gt;=5.3.0

2.0.3PHP &gt;=5.4.0

v4.0.0PHP &gt;=5.4.0 &lt;=7.0.0

v4.5.0PHP &gt;=5.6 &lt;=7.1

v4.2.1PHP &gt;=5.4.0 &lt;=7.0

4.5.x-devPHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a0e0acacc177f3fa8a27ea5064d5d31b249f0cbf08ef985af77de8499b35ced?d=identicon)[shift31](/maintainers/shift31)

---

Top Contributors

[![candasm](https://avatars.githubusercontent.com/u/1390090?v=4)](https://github.com/candasm "candasm (46 commits)")[![bgetsug](https://avatars.githubusercontent.com/u/1869022?v=4)](https://github.com/bgetsug "bgetsug (20 commits)")[![samuelcasas](https://avatars.githubusercontent.com/u/1270065?v=4)](https://github.com/samuelcasas "samuelcasas (1 commits)")[![seebosmile](https://avatars.githubusercontent.com/u/3162188?v=4)](https://github.com/seebosmile "seebosmile (1 commits)")

---

Tags

elasticsearch-clientlaravellaravel-elasticsearchphp

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/shift31-laravel-elasticsearch/health.svg)

```
[![Health](https://phpackages.com/badges/shift31-laravel-elasticsearch/health.svg)](https://phpackages.com/packages/shift31-laravel-elasticsearch)
```

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[echolabsdev/prism

A powerful Laravel package for integrating Large Language Models (LLMs) into your applications.

2.3k388.3k10](/packages/echolabsdev-prism)[sburina/laravel-whmcs-up

WHMCS API client and user provider for Laravel

271.3k](/packages/sburina-laravel-whmcs-up)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
