PHP code example of overtrue / laravel-keycloak-admin
1. Go to this page and download the library: Download overtrue/laravel-keycloak-admin 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/ */
overtrue / laravel-keycloak-admin example snippets
use Overtrue\LaravelKeycloakAdmin\Facades\KeycloakAdmin;
// Get all users
$users = KeycloakAdmin::users()->all();
// Get a user by id
$user = KeycloakAdmin::users()->get('realm', 'user-id');
// Get all groups
KeycloakAdmin::groups()->all();
// Get a group by id
KeycloakAdmin::groups()->get('realm', 'group-id');
// Get all clients
KeycloakAdmin::clients()->all();
// Get a client by id
KeycloakAdmin::clients()->get('realm', 'client-id');
// Get all roles
KeycloakAdmin::roles()->all();
// Get a role by name
KeycloakAdmin::roles()->get('realm', 'role-name');
// Get all realms
KeycloakAdmin::realms()->all();
// Get a realm by name
KeycloakAdmin::realms()->get('realm-name');
php artisan vendor:publish --provider="Overtrue\LaravelKeycloakAdmin\KeycloakServiceProvider"