Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Sam T.'s avatar

php artisan passport:client aborts before letting me enter information to receive credentials

php artisan passport:client aborts before letting me enter information to receive credentials. I am trying to use postman to generate a new access token. In my Laravel app I am trying to run php artisan passport:client but before I can enter the information needed, artisan aborts:

 ?[32mWhich user ID should the client be assigned to??[39m:
 >
?[37;41m            ?[39;49m
?[37;41m  Aborted.  ?[39;49m
?[37;41m            ?[39;49m

Does anyone know why this is happening?

0 likes
1 reply
bobbybouwmann's avatar

If you're trying to fire off an event in your command line when posting something in Postman, I can tell you that this is not going to work!

Instead, you need to utilize the code to generate a token instead

use Laravel\Passport\ClientRepository;

public function __construct(ClientRepository $clientRepository)
{
	$this->clientRepository = $clientRepository;
}

public function handle()
{
	$user = User::first();

	$client = $this->clientRepository->createPasswordGrantClient($user->id, '', 'http://localhost');
}

All classes behind the password commands can be used in your own benefit, like the example above ;)

Please or to participate in this conversation.