-
-
Notifications
You must be signed in to change notification settings - Fork 32
Lumen Installation
Ivan Babenko edited this page Jul 14, 2020
·
1 revision
Note, that the package wasn't designed to be used with Lumen framework, therefore it's not guaranteed, that you won't encounter any bugs or side effects. If you want to proceed anyway, follow the instructions below:
- Add missing helpers in app/helpers.php
<?php declare(strict_types=1);
if (!function_exists('config_path')) {
function config_path($path = '')
{
return app()->basePath() . '/config' . ($path ? '/' . $path : $path);
}
}
if (!function_exists('resolve')) {
function resolve($name, array $parameters = [])
{
return app($name, $parameters);
}
}
- Enable helpers.php autoload in composer.json
"autoload": {
// ...,
"files": [
"app/helpers.php"
]
}
- Install the package via Composer
composer require babenkoivan/elastic-migrations
- Make the config folder
mkdir config
- Copy the configuration files
cp vendor/babenkoivan/elastic-client/config/elastic.client.php config/elastic.client.php
cp vendor/babenkoivan/elastic-migrations/config/elastic.migrations.php config/elastic.migrations.php
- Register container bindings under the Register Container Bindings section in bootstrap/app.php
foreach ((new ElasticMigrations\ServiceProvider($app))->bindings as $abstract => $concrete) {
$app->bind($abstract, $concrete);
}
- Register service providers under the Register Service Providers section in bootstrap/app.php
$app->register(ElasticClient\ServiceProvider::class);
$app->register(ElasticMigrations\ServiceProvider::class);
-
Configure Elasticsearch client in config/elastic.client.php
-
Run the database migrations
php artisan migrate