PHP code example of raditzfarhan / fimm-keycloak

1. Go to this page and download the library: Download raditzfarhan/fimm-keycloak 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/ */

    

raditzfarhan / fimm-keycloak example snippets


protected $routeMiddleware = [
    ...
    'role' => \RaditzFarhan\FimmKeycloak\Middleware\KeycloakRole::class,
];

// The routes in this group will only be accessible by consultant role
Route::middleware(['role:consultant'])->group(function () {
    // your routes here
});

// The routes in this group will only be accessible by fimm_admin or consultant role
Route::middleware(['role:fimm_admin|consultant'])->group(function () {
    // your code here
});

// If by any reason you need to use a different client, just append the client name using @ symbol
// The routes in this group will only be accessible by distributor_admin role from another-app client
Route::middleware(['role:distributor_admin@another-app'])->group(function () {
    // your code here
});