PHPackages                             roshan-dhungana/rbac-kit - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. roshan-dhungana/rbac-kit

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

roshan-dhungana/rbac-kit
========================

Reusable RBAC system for Laravel apps

v1.0.0(1mo ago)00MITPHPPHP &gt;=8.1

Since Jun 6Pushed 1mo agoCompare

[ Source](https://github.com/dhunganaroshan341/rbac-kit)[ Packagist](https://packagist.org/packages/roshan-dhungana/rbac-kit)[ RSS](/packages/roshan-dhungana-rbac-kit/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

RBAC Kit for Laravel
====================

[](#rbac-kit-for-laravel)

A reusable Role-Based Access Control (RBAC) system for Laravel applications. This package provides a structured and scalable way to manage roles and permissions across multiple Laravel projects.

It is built on top of Spatie Laravel Permission and adds opinionated defaults, seeders, and a simplified integration layer for faster setup.

---

Features
--------

[](#features)

- Predefined roles and permissions structure
- Automatic seeding for initial RBAC setup
- Middleware for role and permission checks
- Blade directives for role-based UI control
- API-ready integration with Laravel Sanctum
- Clean and reusable architecture for multiple projects
- Built on top of Spatie Laravel Permission

---

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10 or 11
- Spatie Laravel Permission package

---

Installation
------------

[](#installation)

Install via Composer:

```
composer require roshan-dhungana/rbac-kit
```

Compatibility
-------------

[](#compatibility)

- PHP: 8.1 and above
- Laravel: 10 and 11 (backwards compatibility may exist for other 9.x/10.x versions)

If you'd like, I can add installation examples, config publishing, and quick usage snippets next.

---

Quickstart — Run &amp; Develop
------------------------------

[](#quickstart--run--develop)

These steps cover both consuming the package in a Laravel app and developing it locally.

1. From a new or existing Laravel application (recommended)

```
# In your Laravel app root
composer require roshan-dhungana/rbac-kit
composer require spatie/laravel-permission

php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
php artisan migrate

# Publish the RBAC Kit seeder into your app
php artisan vendor:publish --tag=rbac-kit-seeder

# Seed roles & permissions
php artisan db:seed --class=RolePermissionSeeder

# Run the app
php artisan serve
```

2. Develop the package locally (install into an app via path repository)

- In your Laravel app's `composer.json` add a path repository pointing to this package (adjust path):

```
"repositories": [
	{ "type": "path", "url": "../packages/rbac-kit", "options": { "symlink": true } }
]
```

Then run:

```
composer require roshan-dhungana/rbac-kit:@dev
composer install
php artisan vendor:publish --tag=rbac-kit-seeder
php artisan db:seed --class=RolePermissionSeeder
php artisan serve
```

3. Development notes and common commands

- Ensure `User` model uses `Spatie\Permission\Traits\HasRoles`.
- If `php artisan vendor:publish --tag=rbac-kit-seeder` returns nothing, run it from your Laravel application's root (not inside the package repo).
- To remove accidental `vendor/` commits:

```
git rm -r --cached vendor
git commit -m "Remove vendor from tracking"
git push origin main
```

4. Usage snippets

- Register the policy (automatic if `App\Models\Post` exists) or add to `AuthServiceProvider`:

```
protected $policies = [
		\App\Models\Post::class => \RbacKit\Policies\PostPolicy::class,
];
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance92

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

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

---

Top Contributors

[![dhunganaroshan341](https://avatars.githubusercontent.com/u/79978683?v=4)](https://github.com/dhunganaroshan341 "dhunganaroshan341 (8 commits)")

### Embed Badge

![Health badge](/badges/roshan-dhungana-rbac-kit/health.svg)

```
[![Health](https://phpackages.com/badges/roshan-dhungana-rbac-kit/health.svg)](https://phpackages.com/packages/roshan-dhungana-rbac-kit)
```

###  Alternatives

[althinect/filament-spatie-roles-permissions

3481.1M10](/packages/althinect-filament-spatie-roles-permissions)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k21](/packages/fleetbase-core-api)

PHPackages © 2026

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