PHP code example of l3aro / passportless-for-laravel
1. Go to this page and download the library: Download l3aro/passportless-for-laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use l3aro\Passportless\Concerns\HasPassportless;
class User extends Authenticatable
{
use HasPassportless;
}
$token = $user->createToken('iphone', ['orders:read', 'orders:write']);
// Show / store the plain-text token once. It is not stored in the database.
return ['token' => $token->plainTextToken];