PHPackages                             mobilexco/laravel-scout-elastic - 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. [Search &amp; Filtering](/categories/search)
4. /
5. mobilexco/laravel-scout-elastic

ActiveLibrary[Search &amp; Filtering](/categories/search)

mobilexco/laravel-scout-elastic
===============================

Elastic Driver for Laravel Scout (with AWS IAM capability)

4.0.0(7y ago)3212[1 PRs](https://github.com/MobileXCo/laravel-scout-elastic/pulls)PHPPHP &gt;=5.6.4

Since Sep 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/MobileXCo/laravel-scout-elastic)[ Packagist](https://packagist.org/packages/mobilexco/laravel-scout-elastic)[ RSS](/packages/mobilexco-laravel-scout-elastic/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (6)Versions (20)Used By (0)

Laravel Scout Elasticsearch Driver
==================================

[](#laravel-scout-elasticsearch-driver)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

This package makes is the [Elasticsearch](https://www.elastic.co/products/elasticsearch) driver for Laravel Scout that works with AWS' Elasticsearch and does not require you to put credentials into .env files.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
- [Credits](#credits)
- [License](#license)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require tamayo/laravel-scout-elastic
```

You must add the Scout service provider and the package service provider in your app.php config:

```
// config/app.php
'providers' => [
    ...
    Laravel\Scout\ScoutServiceProvider::class,
    ...
    ScoutEngines\Elasticsearch\ElasticsearchProvider::class,
],
```

Configuration
-------------

[](#configuration)

This package assumes you are following good AWS security and /not/ putting password in your Laravel .env files an instead follows the practices outlined in [Credentials for the AWS SDK for PHP Version 3](https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials.html). To enable this, set the following variable in your .env.

```
ELASTICSEARCH_PROVIDER=aws
```

For local development, inside vagrant for instance, you can use the normal Elasticsearch client by either omitting this variable or setting it as follows.

```
ELASTICSEARCH_PROVIDER=elastic
```

One thing the AWS client needs is the Region. If you don't already have it in your .env, add it as such.

```
AWS_REGION=us-west-2
```

Testing with Scout
------------------

[](#testing-with-scout)

If your CI environment does not have access to a working Elasticsearch instance, any indexed Models will cause it to error. To solve this, add the following to your phpunit.xml. The single quotes wrapping the double quotes are the tricky part there.

```

```

Laravel Configuration
---------------------

[](#laravel-configuration)

After you've published the Laravel Scout package configuration

```
php artisan vendor:publish  --provider="ScoutEngines\Elasticsearch\ElasticsearchProvider"
```

you'll need to update the main scout configuration

```
// config/scout.php
// Set your driver to elasticsearch
    'driver' => env('SCOUT_DRIVER', 'elasticsearch'),

...
    'elasticsearch' => [
        'index' => [
            // if using more than one index, you likely want to change this to each of
            // your indexes. quite possibly using searchableAs on your models.
            env('ELASTICSEARCH_INDEX', 'scout')
        ],
        'hosts' => [
            env('ELASTICSEARCH_HOST', 'http://localhost'),
        ],
        'perModelIndex' => true,
    ],
...
```

and this package's configuration

```
// config/laravel-scout-elastic
// set this if you don't want to include it in your .env
    'provider' => env('ELASTICSEARCH_PROVIDER', 'elasticsearch'),
...
    'region' => env('AWS_REGION', 'us-west-2'),
...
```

and enable the artisan job:

```
// App/Console/Kernel.php
protected $commands = [
    ...
    \App\Console\Commands\CreateIndex::class
    ...
],
```

### Elasticsearch Configuration

[](#elasticsearch-configuration)

Scout will happily throw an error if it cannot create contact your Elasticsearch server or the index doesn't exist.

Creating an index can be kinda arcane, so if the index doesn't exist, you can include the following artisan command in your deployment stack to check if the index exists, and if it doesnt then it will create it.

```
php artisan scout:create-index
```

Usage
-----

[](#usage)

Now you can use Laravel Scout as described in the [official documentation](https://laravel.com/docs/5.3/scout)

Credits
-------

[](#credits)

- [Erick Tamayo](https://github.com/ericktamayo)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~36 days

Recently: every ~65 days

Total

19

Last Release

2872d ago

Major Versions

0.0.1.x-dev → 1.0.0.x-dev2016-09-29

1.0.1.x-dev → 2.0.02017-02-01

2.0.0 → 3.0.02017-02-01

2.0.1 → 3.0.82017-10-24

3.0.9 → 4.0.02018-07-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/d09ee69bfada51cc97c10938d057fa07c926c8696e9adf1e5e3cba3e26b54f9e?d=identicon)[adamgoucher](/maintainers/adamgoucher)

---

Top Contributors

[![ErickTamayo](https://avatars.githubusercontent.com/u/4788817?v=4)](https://github.com/ErickTamayo "ErickTamayo (22 commits)")[![kronthto](https://avatars.githubusercontent.com/u/17156142?v=4)](https://github.com/kronthto "kronthto (5 commits)")[![adamgoucher](https://avatars.githubusercontent.com/u/94401?v=4)](https://github.com/adamgoucher "adamgoucher (3 commits)")[![xcaptain](https://avatars.githubusercontent.com/u/4054836?v=4)](https://github.com/xcaptain "xcaptain (2 commits)")[![bbashy](https://avatars.githubusercontent.com/u/1149200?v=4)](https://github.com/bbashy "bbashy (2 commits)")[![s3gfau1t](https://avatars.githubusercontent.com/u/3099263?v=4)](https://github.com/s3gfau1t "s3gfau1t (2 commits)")[![shibby](https://avatars.githubusercontent.com/u/291643?v=4)](https://github.com/shibby "shibby (2 commits)")[![prajapatinirav](https://avatars.githubusercontent.com/u/7949561?v=4)](https://github.com/prajapatinirav "prajapatinirav (1 commits)")[![pvanhemmen](https://avatars.githubusercontent.com/u/715022?v=4)](https://github.com/pvanhemmen "pvanhemmen (1 commits)")[![tillkruss](https://avatars.githubusercontent.com/u/665029?v=4)](https://github.com/tillkruss "tillkruss (1 commits)")[![semyonchetvertnyh](https://avatars.githubusercontent.com/u/2598761?v=4)](https://github.com/semyonchetvertnyh "semyonchetvertnyh (1 commits)")[![BrianGreenhill](https://avatars.githubusercontent.com/u/1642339?v=4)](https://github.com/BrianGreenhill "BrianGreenhill (1 commits)")[![fridzema](https://avatars.githubusercontent.com/u/8180660?v=4)](https://github.com/fridzema "fridzema (1 commits)")[![clsource](https://avatars.githubusercontent.com/u/292738?v=4)](https://github.com/clsource "clsource (1 commits)")

---

Tags

laravelawselasticsearchelasticscout

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mobilexco-laravel-scout-elastic/health.svg)

```
[![Health](https://phpackages.com/badges/mobilexco-laravel-scout-elastic/health.svg)](https://phpackages.com/packages/mobilexco-laravel-scout-elastic)
```

###  Alternatives

[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

397612.3k](/packages/jeroen-g-explorer)

PHPackages © 2026

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