承接 roshan-dhungana/rbac-kit 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

roshan-dhungana/rbac-kit

Composer 安装命令:

composer require roshan-dhungana/rbac-kit

包简介

Reusable RBAC system for Laravel apps

README 文档

README

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

  • 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

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

Installation

Install via Composer:

composer require roshan-dhungana/rbac-kit

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 & 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
  1. 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
  1. 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
  1. 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,
];

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固