PHP code example of xcoorp / laravel-passport-control

1. Go to this page and download the library: Download xcoorp/laravel-passport-control 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/ */

    

xcoorp / laravel-passport-control example snippets


'guards' => [
    'api' => [
        'driver' => 'passport_control',
        'provider' => 'users',
    ],
],

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});
bash
php artisan vendor:publish --provider="XCoorp\PassportControl\PassportControlServiceProvider"
bash
php artisan migrate