PHP code example of weldist / laravel-passport-client-scopes

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

    

weldist / laravel-passport-client-scopes example snippets


use Laravel\Passport\ClientRepository;

$client = app(ClientRepository::class)->createClientCredentialsGrantClient('Billing Service');

$client->forceFill(['scopes' => ['invoices:read', 'invoices:create']])->save();
bash
php artisan vendor:publish --tag=passport-client-scopes-migrations
php artisan migrate
bash
php artisan vendor:publish --tag=passport-client-scopes-config