PHPackages                             triadev/laravel-elasticsearch-migration - 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. [Database &amp; ORM](/categories/database)
4. /
5. triadev/laravel-elasticsearch-migration

ActiveLibrary[Database &amp; ORM](/categories/database)

triadev/laravel-elasticsearch-migration
=======================================

Elasticsearch migration for laravel.

v1.4.0(7y ago)12[1 PRs](https://github.com/triadev/LaravelElasticsearchMigration/pulls)MITPHPPHP &gt;=7.1

Since Oct 21Pushed 7y ago2 watchersCompare

[ Source](https://github.com/triadev/LaravelElasticsearchMigration)[ Packagist](https://packagist.org/packages/triadev/laravel-elasticsearch-migration)[ RSS](/packages/triadev-laravel-elasticsearch-migration/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (7)Versions (9)Used By (0)

LaravelElasticsearchMigration
=============================

[](#laravelelasticsearchmigration)

[![Software license](https://camo.githubusercontent.com/95adb348c8cdcf0f9aa5aff82840f521429ac74cd50efe8098a66a07d33403e0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f747269616465762f4c61726176656c456c61737469637365617263684d6967726174696f6e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Travis](https://camo.githubusercontent.com/e17fc49082b93dfb896287bb2cd07e6d1b9068361e41a5130247d7dd831982af/68747470733a2f2f7472617669732d63692e6f72672f747269616465762f4c61726176656c456c61737469637365617263684d6967726174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/triadev/LaravelElasticsearchMigration)[![Coveralls](https://camo.githubusercontent.com/3fd0b97853454cba96b2e328dfed8974c8195a922c7c2bae0a1719582ad2c4cb/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f747269616465762f4c61726176656c456c61737469637365617263684d6967726174696f6e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/triadev/LaravelElasticsearchMigration?branch=master)[![CodeCov](https://camo.githubusercontent.com/90c8d4c5f9f69f0f1c8caceae518457f8d9d8de60e6d535950832246108bcc08/68747470733a2f2f636f6465636f762e696f2f67682f747269616465762f4c61726176656c456c61737469637365617263684d6967726174696f6e2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/triadev/LaravelElasticsearchMigration)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/43f6c97e5c4a78784ab6bfb6891b04c0950455b46c11e3a1eaf1d44951af901e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f747269616465762f4c61726176656c456c61737469637365617263684d6967726174696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/triadev/LaravelElasticsearchMigration/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/68fc9d753d9ad1a090ec94a4478474715d9a0e6f82d0abe98c00af9e5fac2a7f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f747269616465762f4c61726176656c456c61737469637365617263684d6967726174696f6e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/triadev/LaravelElasticsearchMigration/?branch=master)[![Build Status](https://camo.githubusercontent.com/64d3e1f4b36bd7830e7683bb8a54908052e56a8b1c58493857e090aa73f53e7c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f747269616465762f4c61726176656c456c61737469637365617263684d6967726174696f6e2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/triadev/LaravelElasticsearchMigration/build-status/master)

[![Latest stable](https://camo.githubusercontent.com/cd8cbe207ae23eaac0dba8bdf62a3da3ad96fcd6a0b0bd807c33ca6d9fa1dac4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747269616465762f6c61726176656c2d656c61737469637365617263682d6d6967726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/triadev/laravel-elasticsearch-migration)[![Latest development](https://camo.githubusercontent.com/d192c9e0033e344633ccb1123264ea84fd6bc9ea602d80396058eb819b59405a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f747269616465762f6c61726176656c2d656c61737469637365617263682d6d6967726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/triadev/laravel-elasticsearch-migration)[![Monthly installs](https://camo.githubusercontent.com/f9a250940c7019ad14ae167733e6be835839b006269f02a3ab14c1494caa4ca2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f747269616465762f6c61726176656c2d656c61737469637365617263682d6d6967726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/triadev/laravel-elasticsearch-migration/stats)

Elasticsearch migration for laravel.

Supported laravel versions
--------------------------

[](#supported-laravel-versions)

[![Laravel 5.5](https://camo.githubusercontent.com/1bd291589054cd0fea96c97b26e57f7dfd024f3d20572a13a74a64e37aa053d6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e352d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://laravel.com)[![Laravel 5.6](https://camo.githubusercontent.com/19208e4e17c5a44f6eeb2ca49987cf944b671fbd1069f1e5cc006c509f119e2b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e362d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://laravel.com)[![Laravel 5.7](https://camo.githubusercontent.com/01e109b20d194f8c9f7398bde86682d9457d92fbf7485b4ffabf6746df741d64/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e372d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://laravel.com)

Supported elasticsearch versions
--------------------------------

[](#supported-elasticsearch-versions)

[![Elasticsearch 6.0](https://camo.githubusercontent.com/810d03fd98470d0400d68f20b1fe4dc219e4a8a887c96ce5ce3b545e71475380/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c61737469637365617263682d362e302d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://www.elastic.co/)[![Elasticsearch 6.1](https://camo.githubusercontent.com/bc2e01ea13c32ac5cb11c1a7dce2abf6d98891c8f4697973715b6f9a5447192c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c61737469637365617263682d362e312d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://www.elastic.co/)[![Elasticsearch 6.2](https://camo.githubusercontent.com/6f0ef3d891eaf0eeb74cb60fdc5c7a74bfe5879aa428ecc5758dea885fc2f920/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c61737469637365617263682d362e322d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://www.elastic.co/)[![Elasticsearch 6.3](https://camo.githubusercontent.com/93ac37d9096d3c081e5a46d1a0aea549f2fe8b8a09bab0fefe2c85a753e55fac/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c61737469637365617263682d362e332d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://www.elastic.co/)[![Elasticsearch 6.4](https://camo.githubusercontent.com/922fceaef72c0a5ab286fd0b454b5c477b97c51b0e13037edd5f763971c9e711/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c61737469637365617263682d362e342d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://www.elastic.co/)

Main features
-------------

[](#main-features)

- Create index
- Update mappings
- Update settings
- Close/Open index for settings update (analyzer, ...)
- Create/Delete alias
- Reindex index
- Delete By Query
- Update by Query

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

[](#installation)

### Composer

[](#composer)

> composer require triadev/laravel-elasticsearch-migration

### Application

[](#application)

The package is registered through the package discovery of laravel and Composer.

>

Once installed you can now publish your config file and set your correct configuration for using the package.

```
php artisan vendor:publish --provider="Triadev\EsMigration\Provider\ElasticsearchMigrationServiceProvider" --tag="config"
```

This will create a file `config/triadev-elasticsearch-migration.php`.

### Configuration

[](#configuration)

KeyEnvValueDescriptionExampleDefaultfilePath---ARRAYpath for file migrations\[KEY =&gt; STRING, ...\]nullMigration via file
------------------

[](#migration-via-file)

The migration file path must be defined in package config.

### Configuration

[](#configuration-1)

KeyValueDescriptionDefaulttypeSTRINGmigration type---paramsARRAYconfiguration---priorityINTEGERorder of migration steps1stopOnFailureBOOLstop on failure at migrationtrue### CLI-Command

[](#cli-command)

The cli-command imports the migration files to database.

> php artisan triadev:es-migration:import-file-migrations {migration} {filePath}

#### migration

[](#migration)

Name of the migration directory.

#### filePath

[](#filepath)

The already defined file path key in package config.

Events
------

[](#events)

[Documentation: Laravel Events](https://laravel.com/docs/5.7/events)

Namespace: Triadev\\EsMigration\\Business\\Events

### Migration

[](#migration-1)

EventStatusMigrationRunningMigration is runningMigrationErrorMigration is failedMigrationDoneMigration is done### Migration - Step

[](#migration---step)

EventStatusMigrationStepRunningMigration step is runningMigrationStepErrorMigration step is failedMigrationStepDoneMigration step is doneRoadmap
-------

[](#roadmap)

- stop migration
- audit logs
- create/delete templates
- shrink index
- split index
- rollover index

Reporting Issues
----------------

[](#reporting-issues)

If you do find an issue, please feel free to report it with GitHub's bug tracker for this project.

Alternatively, fork the project and make a pull request. :)

Testing
-------

[](#testing)

1. docker-compose -f docker-compose.yml up
2. composer test

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Christopher Lorke](https://github.com/triadev)
- [All Contributors](../../contributors)

Other
-----

[](#other)

### Project related links

[](#project-related-links)

- [Wiki](https://github.com/triadev/LaravelElasticsearchMigration/wiki)
- [Issue tracker](https://github.com/triadev/LaravelElasticsearchMigration/issues)

### License

[](#license)

The code for LaravelElasticsearchMigration is distributed under the terms of the MIT license (see [LICENSE](LICENSE)).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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 ~7 days

Total

7

Last Release

2717d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/806ca8236e565a4a76aaad0ad4382dc52f1bc4b7850712878e1fb89826cd2bb8?d=identicon)[triadev](/maintainers/triadev)

---

Top Contributors

[![triadev](https://avatars.githubusercontent.com/u/10552858?v=4)](https://github.com/triadev "triadev (24 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")

---

Tags

elasticsearchlaravelmigrationlaravelmigrationelasticsearch

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[dragon-code/laravel-deploy-operations

Performing any actions during the deployment process

240173.5k2](/packages/dragon-code-laravel-deploy-operations)[pdphilip/elasticsearch

An Elasticsearch implementation of Laravel's Eloquent ORM

145360.2k4](/packages/pdphilip-elasticsearch)[designmynight/laravel-elasticsearch

Use Elasticsearch as a database in Laravel to retrieve Eloquent models and perform aggregations.

3038.6k](/packages/designmynight-laravel-elasticsearch)[matchory/elasticsearch

The missing elasticsearch ORM for Laravel!

3059.0k](/packages/matchory-elasticsearch)

PHPackages © 2026

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