-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Choice question must have at least 1 choice available. #136
Comments
Hello, did you find the answer? |
Hi. Nope. I have used tymon/jwt-auth |
I have the same problem |
Had the same issue. Did a migrate:rollback on all new tables added by lumen-passport and ran php artisan migrate again. For some reason that fixed the error for me :) |
please provide the solution |
I am having the same problem. |
Running |
This worked for me. Thanks! |
Worked for me too. I guess for now I can use this. |
Hi, I already use composer require laravel/passport "8.4.4" but still get the error and couldn't fixed it. Please help me. |
I got this error after trying to go back to "8.4.4"
|
Seems like my phpoffice/phpspreadsheet requires guzzlehttp/guzzle ^7.0 while laravel/passport "8.4.4" requires guzzlehttp/guzzle: 6 so, i don't think downgrading to 8.4.4 is the fix to me Now I just need to find out if "Choice question must have at least 1 choice available" will affect using passport since Password grant client is not created. I'm trying to move from JWT to Passport authentication. EDIT: after some setup in bootstrap\app and config\app, i did |
I try to use php artisan migrate: refresh and php artisan passport:install --force but still not work for me. Can you please share your setup on bootstrap\app and config\app, please? |
this is what's added to bootstrap\app.php
here is from config/auth.php (copy from vendor/laravel/lumen-framework/config/auth.php
then I execute
I don't know which step fixed the problem. but after creating
|
This is works! I follow your code and did the same like you. It save my time. |
@rik72c Hey thanks a lot this worked for me! |
@rik72c Adding the providers to config/auth.php fixed the issue! Great job, thanks! |
I just want to add the fact that, I did exactly same setup as what was shown in the official readme of dusterio/lumen-passport, the config file set up and the bootstrap/app.php set up. The one thing that helped in overcoming this ChoiceQuestion.php line 36 problem was the following. php artisan migrate:fresh Make sure you backup your database because a fresh migration will delete all tables including your data. |
You need to create a config file for auth services as <?php
return [
'defaults' => [
'guard' => 'api',
'passwords' => 'users',
],
'guards' => [
'api' => [
'driver' => 'passport',
'provider' => 'users',
],
],
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => \App\User::class
]
]
]; And after register this on $app->configure('auth'); If you are using Lumen 7+, insert this on $app = new \Dusterio\LumenPassport\Lumen7Application(
dirname(__DIR__)
); So, refresh the database and run php artisan migrate:fresh
php artisan passport:install This worked for me 😉 |
Do not forget to install the default Laravel Passport and then install the Lumen passport
Make sure the bootstrap/app.php file has the following,
Also, set up the auth configuration in config/auth.php (create if not available)
Finally, run the migration and install passport
|
This one fix everything, and everything back to normal. 👍 The problem because when you create fresh installation lumen, there are no config folder (with auth.php) by default. |
in config /auth.php is the main problem un comment that u it will not show any error [ 'guard' => 'api', 'passwords' => 'users', ], 'guards' => [ 'api' => [ 'driver' => 'passport', 'provider' => 'users', ], ], 'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => \App\User::class ] ] ]; /* return [ 'defaults' => [ 'guard' => env('AUTH_GUARD', 'api'), ], 'guards' => [ 'api' => ['driver' => 'api'], 'myguard' => ['driver' => 'mydriver'], ], ]; */ |
if you've ever tried that but doesn't work, use the
option. |
@mateus4k worked for me on Laravel 8 |
you need to set up your provider in you /config/auth.php file |
When I added the user provider, the error was gone! |
just enable the eloquent, that fixed my problem |
Did anyone find a fix to this? |
you are a genious! |
Getting LogicException: Choice question must have at least 1 choice available. ChoiceQuestion.php:36 error when running the php artisan passport:install command. Can you help with this please?
steps:
The text was updated successfully, but these errors were encountered: