overtrue / laravel-keycloak-admin
Laravel wrapper for the keycloak admin library
dev-master
2025-02-18 07:44 UTC
Requires
- php: >=8.4
- fschmtt/keycloak-rest-api-client-php: ^0.30.0
Requires (Dev)
- laravel/pint: dev-main
- orchestra/testbench: ^9.0
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2025-02-18 07:44:33 UTC
README
Package which adds some wrappers for Laravel on top of the fschmtt/keycloak-rest-api-client-php library.
Install
Install the package with composer
composer require overtrue/laravel-keycloak-admin
Publish the config file
php artisan vendor:publish --provider="Overtrue\LaravelKeycloakAdmin\KeycloakServiceProvider"
Usage
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');
More methods can be found in the fschmtt/keycloak-rest-api-client-php library.
LICENSE
MIT