samedi 30 septembre 2017

How to resolve the missing dependency in AuthServiceProvider of laravel while register passport routes

When I'm trying to print laravel routes with following command

php artisan route:list

It throws following exception

[Illuminate\Contracts\Container\BindingResolutionException]
Unresolvable dependency resolving [Parameter #0 [ <required> array $config ]] in class Jenssegers\Mongodb\Connection

if I remove the passport routes from my boot method then it works fine but of course passport routes are not getting printed.

here is my boot method:

public function boot()
    {
        $this->registerPolicies();

        Auth::provider('mongodb', function(Application $app, array $config){
            return new MongoDBUserProvider();
        });

        Passport::routes();

        Passport::tokensExpireIn(Carbon::now()->addDays(15));
        Passport::refreshTokensExpireIn(Carbon::now()->addDays(30));

    }

And if i try to dd(DB::connection('mongodb')->collection('collection_name')->get()); it prints everything fine.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2yyMrgK
via IFTTT

Aucun commentaire:

Enregistrer un commentaire