PHP code example of aplr / laravel-passport-grant-anonymous

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

    

aplr / laravel-passport-grant-anonymous example snippets


Aplr\LaravelPassportAnonymous\ServiceProvider::class,

$http = new GuzzleHttp\Client;

$response = $http->post('http://your-app.com/oauth/token', [
    'form_params' => [
        'grant_type' => 'anonymous',
        'client_id' => 'client-id',
        'client_secret' => 'client-secret',
        'auth_id' => 'some-unique-identifier',
        'scope' => '',
    ],
]);

return json_decode((string) $response->getBody(), true);