A simple bridge between Laravel and Elasticsearch using Elastica, based on https://github.com/valantic/pimcore-elastica-bridge.
- PHP 8.1+
- Laravel 10.0
- Job Batching is setup
You can install the package via composer:
composer require limenet/laravel-elastica-bridge
You can publish and run the migrations with:
php artisan vendor:publish --provider="Limenet\LaravelElasticaBridge\LaravelElasticaBridgeServiceProvider" --tag="elastica-bridge-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --provider="Limenet\LaravelElasticaBridge\LaravelElasticaBridgeServiceProvider" --tag="elastica-bridge-config"
This is the contents of the published config file:
return [
'elasticsearch' => [
'host' => env('ELASTICSEARCH_HOST', 'localhost'),
'port' => env('ELASTICSEARCH_PORT', '9200'),
],
'indices' => [],
'events' => [
'listen' => true,
],
];
- Add
Limenet\LaravelElasticaBridge\Model\ElasticsearchableInterface
andLimenet\LaravelElasticaBridge\Model\ElasticsearchableTrait
to a model - Create a class extending
Limenet\LaravelElasticaBridge\Index\AbstractIndex
- Add the index to your config (
elastica-bridge.indices
) - Run
php artisan elastica-bridge:index
- Check using
php artisan elastica-bridge:status
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.