pmatseykanets/laravel-scout-postgres

Use with Lumen

jake142 opened this issue · 3 comments

I'd love to use this package with Laravel Lumen. When running the migration I get:

lumen.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined function ScoutEngines\Postgres\resolve() in customer/Api/vendor/pmatseykanets/laravel-scout-postgres/src/PostgresEngineServiceProvider.php:12

If i changed to this I got the migrate working:

    $this->app->configure('scout');
    $this->app->singleton(EngineManager::class, function ($app) {
        return (new EngineManager($app))->extend('pgsql', function ($app) {
			return new PostgresEngine($this->app['db'], config('scout.pgsql', []));
        });
    });

Is it possible to use with Lumen?

Thanks for bringing my attention to this. 👍

I just tagged v0.4.1 and updated the readme with the info on how to install and configure the engine in Lumen. Give it a try and let me know if you have any questions.

Hi,

I'm trying to use your engine with lumen 5.7 . but I got the following error:

In Container.php line 779:                                 
  Class path.config does not exist  

Any idea what occurs here?

Regards

I believe that you need to add the following line in bootstrap/app.php
$app->instance('path.config', app()->basePath() . DIRECTORY_SEPARATOR . 'config');