Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save valterlorran/35e167742b95fcc34ce609b299f53089 to your computer and use it in GitHub Desktop.

Select an option

Save valterlorran/35e167742b95fcc34ce609b299f53089 to your computer and use it in GitHub Desktop.
How to creates a laravel passport client programmatically
<?php
// Get the passport client repository
$clientRepository = app('Laravel\Passport\ClientRepository');
// for machine-to-machine authentication
$client = $clientRepository->create(null, 'myclient', '');
// gets the client's id and secret
$clientSecret = $client->secret;
$clientId = $client->id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment