danyal14's avatar

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

Hi Guys,

I am running user API via Lumen + LumenPassword, everything was working fine until I upgraded api from Lumen 5.7 to 5.8

I start getting following error


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

in LumenPassport.php line 88
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

Then following some solutions from Google I updated the AuthServiceProvider

        \Dusterio\LumenPassport\LumenPassport::routes($this->app);

To
        \Dusterio\LumenPassport\LumenPassport::routes($this->app->router);

Now I am getting following error


[2020-01-02 12:10:27] local.ERROR: Illuminate\Contracts\Container\BindingResolutionException: Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in class Illuminate\Support\Manager in /var/www/apps/apis/api_user/vendor/illuminate/container/Container.php

Any idea what to fix?

0 likes
7 replies
danyal14's avatar

Thanks for reply, yes I have followed the steps given in official doc.

bootstrap/app.php

<?php

require_once __DIR__.'/../vendor/autoload.php';

(new Laravel\Lumen\Bootstrap\LoadEnvironmentVariables(
    dirname(__DIR__)
))->bootstrap();

composer

 "require": {
        "php": ">=7.1.3",
        "appzcoder/lumen-routes-list": "^1.0",
        "doctrine/dbal": "^2.9",
        "dusterio/lumen-passport": "dev-master",
        "fideloper/proxy": "^4.1",
        "guzzlehttp/guzzle": "^6.3",
        "laravel/lumen-framework": "5.8.*",
        "laravel/passport": "^7.0",
        "lcobucci/jwt": "^3.3",
        "league/flysystem-aws-s3-v3": "^1.0",
        "vlucas/phpdotenv": "^3.3"
    },
Nakov's avatar

@danyal14 try clearing the cached config files then:

php artisan cache:clear

composer dump-autoload

Your second issue might be related to missing service provider, as far as I can see in the issues on Github: so just add:

Illuminate\Notifications\NotificationServiceProvider to config/app.php providers array.

danyal14's avatar

@nakov

{"status":"fail","message":"Unauthenticated","exception":"Server error: `POST http:\/\/0.0.0.0:8101\/oauth\/token` resulted in a `500 Internal Server Error` response:\n\n\n \n \n

No change, same error

Illuminate\Contracts\Container\BindingResolutionException: Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in class Illuminate\Support\Manager
danyal14's avatar

I found this in google as well, I can't even find lluminate\Notifications\NotificationServiceProvider

When ran composer update, I can't see illuminate containing notification folder. :|

Nakov's avatar

@danyal14 maybe it is not part of the Lumen framework at all, so that's why you can't find it. But it has to be something with a package not being updated for sure. Or you are trying to inject a Service Provider somewhere.

Please or to participate in this conversation.