pmatseykanets / laravel-scout-postgres

PostgreSQL Full Text Search Engine for Laravel Scout
MIT License
159 stars 36 forks source link

Use with Lumen #7

Closed jake142 closed 7 years ago

jake142 commented 7 years ago

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?

pmatseykanets commented 7 years ago

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.

scramatte commented 5 years ago

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

scramatte commented 5 years ago

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