dusterio/lumen-passport

Call to undefined method Laravel\Lumen\Application::group()

danyal14 opened this issue · 3 comments

I upgraded Lumen from 5.7.* to 5.8 followed by methods from official documentation

https://lumen.laravel.com/docs/5.8/upgrade#upgrade-5.8.0

And start getting following issue.

Call to undefined method Laravel\Lumen\Application::group()

(1/1) ErrorCall to undefined method Laravel\Lumen\Application::group()
--
in LumenPassport.php line 87
at LumenPassport::routes(object(Application))in AuthServiceProvider.php line 36
at AuthServiceProvider->boot()
at call_user_func_array(array(object(AuthServiceProvider), 'boot'), array())in BoundMethod.php line 32
at BoundMethod::Illuminate\Container\{closure}()in BoundMethod.php line 90
at BoundMethod::callBoundMethod(object(Application), array(object(AuthServiceProvider), 'boot'), object(Closure))in BoundMethod.php line 34
at BoundMethod::call(object(Application), array(object(AuthServiceProvider), 'boot'), array(), null)in Container.php line 576
at Container->call(array(object(AuthServiceProvider), 'boot'))in Application.php line 244
at Application->bootProvider(object(AuthServiceProvider))in Application.php line 229
at Application->Laravel\Lumen\{closure}(object(AuthServiceProvider), 'App\\Providers\\AuthServiceProvider')

I'm getting this issue with Lumen 6.0. :( Not sure how to fix it, I don't really want to keep downgrading my Lumen version.

If anybody is looking for an answer. It should be LumenPassport::routes($this->app->router); instead of LumenPassport::routes($this->app); in AuthServiceProvider

\Dusterio\LumenPassport\LumenPassport::routes($app, ['prefix' => 'v1/oauth']);
change to
\Dusterio\LumenPassport\LumenPassport::routes($app->router);