PHPackages                             marionassef/laravel-keycloak-admin-rest-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. marionassef/laravel-keycloak-admin-rest-api

ActiveLibrary[Admin Panels](/categories/admin)

marionassef/laravel-keycloak-admin-rest-api
===========================================

laravel keycloak admin rest api

v2.1.0(3mo ago)28.4k↑75%2MITPHPPHP ^8.0

Since Mar 16Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/marionassef/laravel-keycloak-admin-rest-api)[ Packagist](https://packagist.org/packages/marionassef/laravel-keycloak-admin-rest-api)[ Docs](https://github.com/marionassef/laravel-keycloak-admin-rest-api)[ RSS](/packages/marionassef-laravel-keycloak-admin-rest-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (15)Used By (0)

### This is a forked repository from

[](#this-is-a-forked-repository-from-httpsgithubcommnikoeilaravel-keycloak-admin)

Original work credited to Mnikoei.

### Installtion

[](#installtion)

```
composer require marionassef/laravel-keycloak-admin-rest-api

```

### Copy the package config to your local config with the publish command:

[](#copy-the-package-config-to-your-local-config-with-the-publish-command)

```
php artisan vendor:publish --provider="laravelKeycloakAdminRestApi\KeycloakAdminServiceProvider"
```

#### laravel-keycloak-admin

[](#laravel-keycloak-admin)

Add these environment variables to your .env :

```
KEYCLOAK_BASE_URL=http://keycloak-domain.example/auth

KEYCLOAK_REALM=

KEYCLOAK_REALM_PUBLIC_KEY=     # realm settings -> keys

KEYCLOAK_ADMIN_CLIENT_ID=

KEYCLOAK_ADMIN_CLIENT_UUID=

KEYCLOAK_ADMIN_CLIENT_SECRET=        # clients -> your_client -> credentials

KEYCLOAK_ADMIN_BASE_URL=${KEYCLOAK_BASE_URL}/admin/realms/${KEYCLOAK_REALM}

```

#### Enable realm managment

[](#enable-realm-managment)

Go to `clients -> your_client -> Service Account` then select realm-managment

from Client Roles list and assign realm-admin to client.

#### Available methods :

[](#available-methods-)

Package has provided services as below:

- user
- role
- client
- clientRole
- group
- organization

All api's are decleared in `config\keycloakAdmin.php`

For every api just needs call api name as method on related service .

Example:

```
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'

]);
```

#### Organization API Examples:

[](#organization-api-examples)

```
// Create an organization
KeycloakAdmin::organization()->create([
    'body' => [
        'name' => 'My Organization',
        'alias' => 'my-org',
        'enabled' => true,
        'domains' => ['example.com']
    ]
]);

// Get all organizations
KeycloakAdmin::organization()->all();

// Search organizations by name
KeycloakAdmin::organization()->search([
    'search' => 'org-name'
]);

// Get organization by ID
KeycloakAdmin::organization()->get([
    'id' => 'organization-uuid'
]);

// Update organization
KeycloakAdmin::organization()->update([
    'id' => 'organization-uuid',
    'body' => [
        'name' => 'Updated Organization Name'
    ]
]);

// Delete organization
KeycloakAdmin::organization()->delete([
    'id' => 'organization-uuid'
]);

// Get organization members
KeycloakAdmin::organization()->getMembers([
    'id' => 'organization-uuid'
]);

// Add member to organization
KeycloakAdmin::organization()->addMember([
    'id' => 'organization-uuid',
    'userId' => 'user-uuid'
]);

// Remove member from organization
KeycloakAdmin::organization()->removeMember([
    'id' => 'organization-uuid',
    'userId' => 'user-uuid'
]);

// Invite user to organization
KeycloakAdmin::organization()->inviteUser([
    'id' => 'organization-uuid',
    'body' => [
        'email' => 'user@example.com',
        'firstName' => 'John',
        'lastName' => 'Doe'
    ]
]);

// Get organization identity providers
KeycloakAdmin::organization()->getIdentityProviders([
    'id' => 'organization-uuid'
]);

// Link identity provider to organization
KeycloakAdmin::organization()->linkIdentityProvider([
    'id' => 'organization-uuid',
    'alias' => 'idp-alias'
]);

// Unlink identity provider from organization
KeycloakAdmin::organization()->unlinkIdentityProvider([
    'id' => 'organization-uuid',
    'alias' => 'idp-alias'
]);

// Get organizations for a user
KeycloakAdmin::organization()->getUserOrganizations([
    'userId' => 'user-uuid'
]);
```

> **Note:** Organization APIs require Keycloak 24+ with organizations feature enabled.

All other api calls are same as examples just needs to provide required parameters as described in

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance80

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~118 days

Recently: every ~340 days

Total

13

Last Release

103d ago

Major Versions

v1.8 → v2.0.02025-06-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/b950fe3241baab01084d9eae27526ade7fa888ecbfa68a1dc8b24994f1e8f9c1?d=identicon)[MarioNassef](/maintainers/MarioNassef)

---

Top Contributors

[![marionassef](https://avatars.githubusercontent.com/u/16724850?v=4)](https://github.com/marionassef "marionassef (19 commits)")

---

Tags

laraveladminkeycloak

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/marionassef-laravel-keycloak-admin-rest-api/health.svg)

```
[![Health](https://phpackages.com/badges/marionassef-laravel-keycloak-admin-rest-api/health.svg)](https://phpackages.com/packages/marionassef-laravel-keycloak-admin-rest-api)
```

###  Alternatives

[slowlyo/owl-admin

基于 laravel、amis 开发的后台框架~

61214.2k26](/packages/slowlyo-owl-admin)[sebastienheyd/boilerplate

Laravel Boilerplate based on AdminLTE 3 with blade components, user management, roles, permissions, logs viewer, ...

28618.2k3](/packages/sebastienheyd-boilerplate)[lokielse/laravel-admin-generator

An Admin Panel Generator for Laravel 5

712.0k](/packages/lokielse-laravel-admin-generator)[serverfireteam/blog

A nice blog system with laravel and laravelpanel

523.1k](/packages/serverfireteam-blog)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
