To create a personal access client with passport in laravel, I need to run this command: php artisan passport:client --personal
I'm trying to run this command through Artisan::call('command', ['--flag'=>'value'])
The issue I'm having here is, passport prompts for an input to name the access token or accept a default one and the command gets stuck there. Is there any way I can give it any input? The Enter
key press does the work on console.
Solution
Default Name: php artisan passport:client --personal --no-interaction
Custom Name: php artisan passport:client --personal --name=AccessTokenName
Found it in the source: https://github.com/laravel/passport/blob/2.0/src/Console/ClientCommand.php
Try running the command with the --no-interaction
flag set. See php artisan passport:client --help
for more options.