Passport: cant run passport install

Created on 17 May 2020  ·  6Comments  ·  Source: laravel/passport


  • Passport Version: 9.2.1
  • Lumen Version: 6.x
  • PHP Version: 7.3
  • Database Driver & Version:

Description:

λ php artisan passport:install

In InstallCommand.php line 34:
array_keys() expects parameter 1 to be array, null given

Steps To Reproduce:

php artisan passport:install

Most helpful comment

You need to modify bootstrap/app.php file
Please remove comment from following lines:
$app->withFacades();

$app->withEloquent();

$app->routeMiddleware([
'auth' => App\Http\Middleware\Authenticate::class,
]);
$app->register(App\Providers\AppServiceProvider::class);
$app->register(App\Providers\AuthServiceProvider::class);
$app->register(App\Providers\EventServiceProvider::class);

And register your PassportServiceProvider in following way.

$app->register(Laravel\Passport\PassportServiceProvider::class);
$app->register(Dusterio\LumenPassport\PassportServiceProvider::class);
I hope by doing this you can resolve your problem.

All 6 comments

Can't reproduce.

facing same issue.
Lumen: 7.1.3
Passport: 9.2.1
PHP 7.3.5

Description
when running php artisan passport:install
getting error

In InstallCommand.php line 34:
array_keys() expects parameter 1 to be array, null given

You need to modify bootstrap/app.php file
Please remove comment from following lines:
$app->withFacades();

$app->withEloquent();

$app->routeMiddleware([
'auth' => App\Http\Middleware\Authenticate::class,
]);
$app->register(App\Providers\AppServiceProvider::class);
$app->register(App\Providers\AuthServiceProvider::class);
$app->register(App\Providers\EventServiceProvider::class);

And register your PassportServiceProvider in following way.

$app->register(Laravel\Passport\PassportServiceProvider::class);
$app->register(Dusterio\LumenPassport\PassportServiceProvider::class);
I hope by doing this you can resolve your problem.

I am also facing the same issue and have uncommented all the above but still passport:install fails

You need to modify bootstrap/app.php file
Please remove comment from following lines:
$app->withFacades();

$app->withEloquent();

$app->routeMiddleware([
'auth' => App\Http\Middleware\Authenticate::class,
]);
$app->register(App\Providers\AppServiceProvider::class);
$app->register(App\Providers\AuthServiceProvider::class);
$app->register(App\Providers\EventServiceProvider::class);

And register your PassportServiceProvider in following way.

$app->register(Laravel\Passport\PassportServiceProvider::class);
$app->register(Dusterio\LumenPassport\PassportServiceProvider::class);
I hope by doing this you can resolve your problem.

This works but then another error prompts "Choice question must have at least 1 choice available"

This might help
https://github.com/dusterio/lumen-passport/issues/136#issuecomment-662334237

I solved it adding auth.providers key in auth.app:

   'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\User::class,
        ],
Was this page helpful?
0 / 5 - 0 ratings

Related issues

andcl picture andcl  ·  3Comments

SwiTool picture SwiTool  ·  3Comments

s4uron picture s4uron  ·  3Comments

seriousjelly picture seriousjelly  ·  3Comments

brryfrmnn picture brryfrmnn  ·  3Comments