三级角色体系:super admin、admin、user,super admin 通过 Gate::before 绕过权限检查并从用户列表隐藏
laravel-admin-starter-kit — Laravel 后台模板
作者 RiteshMistri
基于 Laravel 与 TailAdmin 的后台启动模板,内置认证、三级角色与模块化权限管理。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 2
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
权限采用 module.action 点号命名,如 user-management.read/add/edit/delete,由 Spatie Laravel Permission 管理
权限矩阵表格支持列头全选,勾选 add/edit/delete 时自动补上同模块 read
用户管理提供完整 CRUD,并支持角色分配与单用户权限覆盖
界面基于 TailAdmin,使用 TailwindCSS 与 Alpine.js,含仪表盘图表、日历及多个 UI 组件页面
新增模块只需在 RolesAndPermissionsSeeder 追加权限条目并重新执行 seeder
模板详细介绍
这是一个 Laravel 后台启动模板,前端界面采用 TailAdmin,认证部分使用 Laravel Breeze,权限管理依赖 Spatie Laravel Permission。仓库描述与 README 均指向同一目标:为后台项目提供可直接复用的骨架,省去认证、角色与权限界面的重复搭建。
权限体系为三级角色:super admin、admin、user。super admin 通过 AppServiceProvider 中的 Gate::before 绕过所有权限检查,并在用户列表中隐藏;admin 默认获得全部模块权限;user 默认获得各模块的 read 权限。权限采用 module.action 的点号命名,例如 user-management.read、user-management.add、user-management.edit、user-management.delete。
管理端提供权限矩阵表格用于分配权限:列头复选框可一次性勾选某类操作,勾选 add/edit/delete 会自动补上同模块的 read,取消单行不会影响列头状态。新增模块只需在 RolesAndPermissionsSeeder 的权限数组中按同样命名追加条目并重新执行该 seeder,矩阵界面会自动分组展示。
模板还包含用户管理 CRUD、预置仪表盘与 ApexCharts 图表、FullCalendar 日历,以及 Alerts、Badges、Buttons、Avatars、Images、Videos 等 UI 组件页面。数据库支持 MySQL 或 SQLite,通过 .env 配置;资源由 Vite 打包。安装步骤为 composer install、npm install、复制 .env 并生成 key、配置数据库、执行 php artisan migrate --seed、构建前端资源后启动服务。种子数据会创建角色、权限以及 [email protected] 与 [email protected] 两个默认账号。
使用限制:仓库 stars 为 0,未提供生产环境验证信息;README 中关于“生产可用”的表述属于作者自述,不应视为已核实的结论。演示图片、字体、图标等第三方素材需单独核对许可,域名、托管、数据库等外部服务可能另行收费。
适合你的项目吗?
适用场景
- 需要快速搭建带登录注册、密码重置与邮箱验证的 Laravel 后台项目
- 需要按角色与模块粒度控制后台操作权限,并希望有可视化权限分配界面
- 需要在后台中管理用户账号、分配角色并覆盖个别用户权限
- 需要现成的仪表盘图表、日历或基础 UI 组件页面作为后台界面起点
适合人群
- 使用 Laravel 并希望跳过认证与权限脚手架搭建的开发者
- 需要模块化权限矩阵而非简单角色判断的后台项目
- 接受以 TailAdmin 作为后台界面基础、并愿意在其上二次开发的团队
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
环境要求:PHP 8.2+、Composer、Node.js 18+ 与 npm,数据库可用 MySQL 或 SQLite
- 2
依次执行 composer install、npm install、复制 .env.example 为 .env 并运行 php artisan key:generate
- 3
在 .env 中配置数据库连接后执行 php artisan migrate --seed,会创建角色、权限及默认账号
- 4
开发时运行 npm run dev,生产构建使用 npm run build,随后用 php artisan serve 启动
- 5
默认登录账号为 [email protected] 与 [email protected],密码均为 password,上线前应更换
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 超级管理员账号不会出现在用户列表中,无法通过用户管理界面查看或编辑该账号。
- 超级管理员角色绕过所有权限检查,无法通过权限矩阵限制其操作。
- 在权限矩阵中勾选某模块的添加、编辑或删除权限时,系统会自动同时勾选该模块的读取权限。
- 取消勾选单行权限不会同步更新列头复选框状态,列头可能仍显示为已选中。
- 种子数据会创建默认账号 [email protected] 与 [email protected],密码均为 password,上线前必须更换。
- 需要自行准备并配置 MySQL 或其他受支持的数据库,数据库服务可能产生额外费用。
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
The Super Admin account is hidden from the Users list for security reasons.
README 原文
Super Admin automatically bypasses all permission checks via `Gate::before`
README 原文
Selecting `Add`, `Edit`, or `Delete` automatically checks `Read` for that module
README 原文
Unchecking an individual row does not affect the column header state
README 原文
Create default Super Admin (`[email protected]`) and Admin (`[email protected]`) accounts
README 原文
https://github.com/RiteshMistri/laravel-admin-starter-kit/blob/master/LICENSEhttps://github.com/RiteshMistri/laravel-admin-starter-kit/blob/master/README.mdMySQL or another supported database
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-01。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 85 / 100
- 技术栈
- Laravel
- 网站类型
- 后台 · 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-09-28
- 截图检查日期
- 2026-10-01
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Laravel。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。
查看当时使用的来源资料
SHA-256: e760fd296259c591f1f998eb8746c0a45ca4170e8311fe84cb09d612a89d56d4
2026-10-01T02:26:09.860Z
来源文件 / 仓库<h1 align="center">
<br>
<a href="https://github.com/RiteshMistri/laravel-admin-starter-kit">
<img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="300" alt="Laravel Admin Starter Kit">
</a>
<br>
Laravel Admin Starter Kit
<br>
</h1>
<h4 align="center">A full-featured, production-ready Laravel Admin Panel Starter Kit with Role-Based Access Control, Module-Based Permissions, and a modern TailAdmin UI — built to save you days of boilerplate work.</h4>
<p align="center">
<a href="https://github.com/RiteshMistri/laravel-admin-starter-kit/blob/main/LICENSE">
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License">
</a>
<img src="https://img.shields.io/badge/Laravel-12.x-red?logo=laravel" alt="Laravel 12">
<img src="https://img.shields.io/badge/PHP-8.2+-blue?logo=php" alt="PHP 8.2+">
<img src="https://img.shields.io/badge/TailwindCSS-4.x-cyan?logo=tailwindcss" alt="TailwindCSS">
<img src="https://img.shields.io/badge/Alpine.js-3.x-lightblue?logo=alpine.js" alt="Alpine.js">
<img src="https://img.shields.io/badge/Spatie%20Permissions-7.x-green" alt="Spatie Permissions">
</p>
<p align="center">
<a href="#-key-features">Key Features</a> •
<a href="#-demo-credentials">Demo</a> •
<a href="#-tech-stack">Tech Stack</a> •
<a href="#-installation">Installation</a> •
<a href="#-role--permission-system">Permissions</a> •
<a href="#-folder-structure">Structure</a> •
<a href="#-contributing">Contributing</a>
</p>
---
## 🚀 Key Features
- **🔐 3-Tier Role System** — Super Admin, Admin, and User roles, each with different access levels
- **🛡️ Module-Based Permissions** — Fine-grained, dotted permissions (e.g., `user-management.read`, `user-management.add`) using Spatie's Laravel Permission package
- **✅ Permissions Matrix UI** — Intuitive table-based permission assignment with master "Select All" column headers per action
- **👑 Super Admin Bypass** — Super Admin automatically bypasses all permission checks via `Gate::before` — no need to manually assign permissions
- **👤 User Management** — Full CRUD for users with role assignment and per-user permission overrides
- **🎨 TailAdmin UI** — Beautiful, responsive admin UI built with TailwindCSS v4 and Alpine.js
- **🔑 Laravel Breeze Auth** — Authentication scaffolding (Login, Register, Password Reset, Email Verification)
- **📊 Dashboard & Charts** — Pre-built dashboard with ApexCharts integration
- **📅 Calendar** — FullCalendar.js integration for event management
- **🧩 UI Components** — Pre-built Alerts, Badges, Buttons, Avatars, Images, Videos pages
- **⚡ Vite Asset Bundling** — Fast dev server and optimized production builds
---
## 🖥️ Demo Credentials
After seeding, you can log in with these default accounts:
| Role | Email | Password |
|-------------|---------------------|------------|
| Super Admin | `[email protected]` | `password` |
| Admin | `[email protected]` | `password` |
> **Note:** The Super Admin account is hidden from the Users list for security reasons.
---
## 🛠️ Tech Stack
| Layer | Technology |
|--------------|-------------------------------------|
| Framework | Laravel 12.x |
| Language | PHP 8.2+ |
| Auth | Laravel Breeze |
| Permissions | Spatie Laravel Permission 7.x |
| Frontend CSS | TailwindCSS 4.x + @tailwindcss/forms|
| Frontend JS | Alpine.js 3.x |
| Asset Build | Vite + laravel-vite-plugin |
| Charts | ApexCharts |
| Calendar | FullCalendar.js |
| Date Picker | Flatpickr |
| HTTP Client | Axios |
| Database | MySQL / SQLite (configurable) |
---
## 📦 Installation
### Prerequisites
- PHP >= 8.2
- Composer
- Node.js >= 18.x & npm
- MySQL or another supported database
### Steps
**1. Clone the repository**
```bash
git clone https://github.com/RiteshMistri/laravel-admin-starter-kit.git
cd laravel-admin-starter-kit
```
**2. Install PHP dependencies**
```bash
composer install
```
**3. Install Node.js dependencies**
```bash
npm install
```
**4. Set up the environment file**
```bash
cp .env.example .env
php artisan key:generate
```
**5. Configure your database**
Open `.env` and update your database credentials:
```env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel_admin_starter
DB_USERNAME=root
DB_PASSWORD=
```
**6. Run database migrations and seed default data**
```bash
php artisan migrate --seed
```
This will automatically:
- Create all tables
- Create the `super admin`, `admin`, and `user` roles
- Create module-based permissions (`user-management.read`, etc.)
- Create default Super Admin (`[email protected]`) and Admin (`[email protected]`) accounts
**7. Build assets**
```bash
# For development (with hot reload)
npm run dev
# For production
npm run build
```
**8. Start the development server**
```bash
php artisan serve
```
Visit [http://localhost:8000](http://localhost:8000) and log in with the demo credentials above.
---
## 🔑 Role & Permission System
This starter kit implements a **3-tier access control system**:
### Roles
| Role | Description |
|-------------|-------------|
| `super admin` | Full unrestricted access to everything. Bypasses all permission checks via `Gate::before`. Hidden from user lists. |
| `admin` | Can access admin panel features based on assigned permissions. Gets all module permissions by default. |
| `user` | Basic access. Gets `read` permission on each module by default. |
### Module-Based Permissions
Permissions follow a dotted `module.action` syntax:
```
user-management.read
user-management.add
user-management.edit
user-management.delete
```
> Add new modules by simply adding entries to `RolesAndPermissionsSeeder.php` following the same pattern. The UI will automatically group them in the Permissions Matrix.
### Permissions Matrix UI
The admin panel provides a **Permissions Matrix Table** for visual, user-friendly permission assignment:
- ✅ **Column Header Checkbox** — Check "Read" in the header to select all `Read` checkboxes across all modules at once
- ✅ **Smart Auto-Select** — Selecting `Add`, `Edit`, or `Delete` automatically checks `Read` for that module (you can't add without seeing)
- ✅ **One-Way Binding** — Unchecking an individual row does not affect the column header state
### Super Admin Gate Bypass
In `app/Providers/AppServiceProvider.php`:
```php
Gate::before(function ($user, $ability) {
if ($user->hasRole('super admin')) {
return true;
}
});
```
---
## 📂 Folder Structure
Key files and directories to know about:
```
├── app/
│ ├── Http/
│ │ └── Controllers/
│ │ └── Admin/
│ │ └── UserController.php # Admin User CRUD
│ └── Providers/
│ └── AppServiceProvider.php # Gate::before (Super Admin bypass)
│
├── database/
│ ├── migrations/
│ └── seeders/
│ ├── DatabaseSeeder.php
│ └── RolesAndPermissionsSeeder.php # Roles, Permissions, Default Users
│
├── resources/
│ └── views/
│ ├── admin/
│ │ └── users/
│ │ ├── index.blade.php # User list (paginated)
│ │ ├── create.blade.php # Create user + permissions matrix
│ │ └── edit.blade.php # Edit user + permissions matrix
│ ├── layouts/
│ │ └── app.blade.php # Main layout wrapper
│ └── pages/
│ └── dashboard/ # Dashboard views
│
├── routes/
│ ├── web.php # App + Admin routes
│ └── auth.php # Breeze auth routes
│
├── tailwind.config.js
├── vite.config.js
└── .env.example
```
---
## 🧪 Running Tests
```bash
php artisan test
```
---
## ⚙️ Adding New Modules / Permissions
1. Open `database/seeders/RolesAndPermissionsSeeder.php`
2. Add your new permissions to the `$permissions` array:
```php
$permissions = [
// Existing
'user-management.read',
'user-management.add',
'user-management.edit',
'user-management.delete',
// New module example
'product-management.read',
'product-management.add',
'product-management.edit',
'product-management.delete',
];
```
3. Re-run the seeder:
```bash
php artisan db:seed --class=RolesAndPermissionsSeeder
```
The Permissions Matrix UI will automatically display the new module grouped correctly.
---
## 🤝 Contributing
Contributions, issues and feature requests are welcome! Here's how to get started:
1. **Fork** the repository
2. Create your feature branch: `git checkout -b feature/my-new-feature`
3. Commit your changes: `git commit -m 'Add some feature'`
4. Push to the branch: `git push origin feature/my-new-feature`
5. Open a **Pull Request**
Please make sure to update tests as appropriate.
---
## 📄 License
This project is open-sourced software licensed under the [MIT License](LICENSE).
---
## 🙏 Credits
- [Laravel](https://laravel.com) — The PHP Framework for Web Artisans
- [TailAdmin](https://tailadmin.com) — Tailwind CSS Admin Dashboard Template
- [Spatie Laravel Permission](https://spatie.be/docs/laravel-permission) — Role & Permission management
- [Alpine.js](https://alpinejs.dev) — Lightweight reactive JavaScript framework
- [TailwindCSS](https://tailwindcss.com) — Utility-first CSS framework
---
---
## 👨💻 About the Author
**Ritesh Mistri** — Laravel Developer passionate about building clean, scalable, and developer-friendly web applications.
- 🌐 Website: [riteshmistri.site](https://riteshmistri.site/)
- 🔗 LinkedIn: [linkedin.com/in/ritesh-mistri777](https://www.linkedin.com/in/ritesh-mistri777/)
- 💻 GitHub: [github.com/RiteshMistri](https://github.com/RiteshMistri)
---
<p align="center">Built to help developers save time — by <a href="https://riteshmistri.site/">Ritesh Mistri</a></p>
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

sage
WordPress starter theme with Laravel Blade components and templates, Tailwind CSS, and block editor support
Laravel · 启动器

wave
Wave - The Software as a Service Starter Kit, designed to help you build the SAAS of your dreams 🚀 💰
Laravel · SaaS

coreui-free-laravel-admin-template
CoreUI Free Laravel Bootstrap Admin Template
Laravel · 后台

sneat-bootstrap-html-laravel-admin-template-free
Most Powerful & Comprehensive Free Bootstrap 5 HTML Laravel Admin Dashboard Template built for developers!
Laravel · 后台

filament-starter
A beautiful starting point for your next TALL stack project using Filament. ⚡
Laravel · 启动器

electrik
Laravel SaaS starter kit: auth, teams, Stripe billing, and Slate 3 — Composer package for Laravel 12
Laravel · SaaS
