λ php artisan passport:install
In InstallCommand.php line 34:
array_keys() expects parameter 1 to be array, null given
php artisan passport:install
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,
],
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.