Skip to content

passport install does not work out of the box #1838

@tothsanka

Description

@tothsanka

Passport Version

13.0.6

Laravel Version

12.21.0

PHP Version

8.4.10

Database Driver & Version

MySql 8

Description

run:
php artisan passport:install

Makes an error:

Choice question must have at least 1 choice available.

at vendor/symfony/console/Question/ChoiceQuestion.php:38
34▕ private array $choices,
35▕ string|bool|int|float|null $default = null,
36▕ ) {
37▕ if (!$choices) {
➜ 38▕ throw new \LogicException('Choice question must have at least 1 choice available.');
39▕ }
40▕
41▕ parent::__construct($question, $default);
42▕

Steps To Reproduce

php artisan passport:install
Would you like to run all pending database migrations? (yes/no) [yes]: hit enter
Would you like to create the "personal access" grant client? (yes/no) [yes]: hit enter

Error message appears:
Choice question must have at least 1 choice available.

at vendor/symfony/console/Question/ChoiceQuestion.php:38
34▕ private array $choices,
35▕ string|bool|int|float|null $default = null,
36▕ ) {
37▕ if (!$choices) {
➜ 38▕ throw new \LogicException('Choice question must have at least 1 choice available.');
39▕ }
40▕
41▕ parent::__construct($question, $default);
42▕

Fix in InstallCommand: the provider is missing, personal should have no value
if ($this->components->confirm('Would you like to create the "personal access" grant client?', true)) {
$this->call('passport:client', [
'--personal' => null,
'--name' => config('app.name'),
'--provider' => 'users'
]);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions