PHP code example of danilopolani / laravel-fusionauth-jwt
1. Go to this page and download the library: Download danilopolani/laravel-fusionauth-jwt 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/ */
danilopolani / laravel-fusionauth-jwt example snippets
use DaniloPolani\FusionAuthJwt\FusionAuthJwtUser;
$this
->actingAs(
new FusionAuthJwtUser([
'roles' => ['user', 'admin'],
]),
'fusionauth',
)
->get('/api/users')
->assertOk();
use DaniloPolani\FusionAuthJwt\FusionAuthJwtUser;
use Illuminate\Support\Facades\Auth;
Auth::guard('fusionauth')->setUser(
new FusionAuthJwtUser([
'roles' => ['user', 'admin'],
])
);