spatie/laravel-glide

Lumen Support

developernaren opened this issue · 2 comments

This is a request. I am working in Lumen but cannot just figure how to get this working. Can you create a package to support Lumen?

I haven't used Lumen myself. I suppose the package should work if you install the facade and the service provider. If not, please reopen this issue and let me know which error you are getting.

Sorry for the late reply.

Well, I tried with the facades and service, the issue that I get is that is that it says the class router does not exist

$this->publishes([
        __DIR__.'/../../config/laravel-glide.php' => config_path('laravel-glide.php'),
    ], 'config');
    $glideConfig = config('laravel-glide');
    $this->app['router']->get($glideConfig['baseURL'].'/{all}', 'Spatie\Glide\Controller\GlideImageController@index')->where('all', '.*');
}

This is the part with the error in file GlideServiceProvider.php in line 24. It says

function config_path() not found. I tried to remove the line and make it work.

The error was when I published the config so I added the config directly, laravel-glide.php in config.
we have to register the config separately as well.

$app->configure('laravel-glide');
in `bootstrap/app.php``

I changed it and got the config working and commented the line in the vendor file.

and next error after I remove the line is
class router not found
because of this line
$this->app['router']->get($glideConfig['baseURL'].'/{all}', 'Spatie\Glide\Controller\GlideImageController@index')->where('all', '.*');

the way lumen uses the class $this->app as app() I tried and changed the line to

$router = app()->make('router'); $router->get($glideConfig['baseURL'].'/{all}', 'Spatie\Glide\Controller\GlideImageController@index')->where('all', '.*');

it said class router not found.
I looked around and tried to find if there are other references lumen makes to router class, I just could not find the answer. I played around and search for the answer and tried to solve this but just could not. I played around for about 2 hours and I gave up.