'Php lumen, artisan passport:install error
Following all the instructions in the document of dusterio / lumen-passport,
Running php artisan passport:install after all the instructions in the document gives me the following error.
Encryption keys generated successfully.
Personal access client created successfully.
Client ID: 1
Client secret: EQXIlANzcONLH7IvXOi6bRuSHxOqemZVKjMOHC5I
In ChoiceQuestion.php line 36:
Choice question must have at least 1 choice available.
Been on this the entire night.
Solution 1:[1]
First of all, I guess you have followed this documentation.
This type of error comes when $app->configure('auth'); could not find the auth.php at <YOUR_PROJECT>/config/auth.php.
While make mistake to put the config directory in app viz. <YOUR_PROJECT>/app/config/auth.php
Check the config directory location, it must be just under the project's root directory.
Solution 2:[2]
STEP 1: Add $app->configure('auth'); in your bootstrap\app.php
$app->register(App\Providers\AuthServiceProvider::class);
$app->register(Laravel\Passport\PassportServiceProvider::class);
$app->register(Dusterio\LumenPassport\PassportServiceProvider::class);
$app->configure('auth');
STEP 2: Go to file vendor\laravel\lumen-framework\config\auth.php and change the 'guards' and 'providers'
'guards' => [
'api' => [
'driver' => 'passport',
'provider' => 'users'
],
],
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => \App\Models\User::class
]
],
STEP 3: Run php artisan migrate:fresh
STEP 4: Run php artisan passport:install --force
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dinesh Suthar |
| Solution 2 |
