PHP code example of marionassef / laravel-keycloak-admin-rest-api

1. Go to this page and download the library: Download marionassef/laravel-keycloak-admin-rest-api 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/ */

    

marionassef / laravel-keycloak-admin-rest-api example snippets


KeycloakAdmin::serviceName()->apiName($parameters)



keycloakAdmin::user()->create([
      
     'body' => [  // https://www.keycloak.org/docs-api/7.0/rest-api/index.html#_userrepresentation
             
             'username' => 'foo'
              
       ]

]);



keycloakAdmin::user()->update([

     'id' => 'user_id',

     'body' => [  // https://www.keycloak.org/docs-api/7.0/rest-api/index.html#_userrepresentation
             
             'username' => 'foo'
              
       ]

]);



keycloakAdmin::role()->get([
      
     'id' => 'role_id'

]);
shell
php artisan vendor:publish --provider="laravelKeycloakAdminRestApi\KeycloakAdminServiceProvider"
config\keycloakAdmin.php