abitbt/filament
Composer 安装命令:
composer create-project abitbt/filament
包简介
Laravel 13 starter kit with Filament 5, featuring RBAC, activity logging, and demo components.
README 文档
README
A production-ready starter kit for building admin panels and internal tools with Laravel 13 and Filament 5. Includes a complete RBAC system, activity logging, and demo components to accelerate your development.
Why This Starter Kit?
- Skip the boilerplate - Authentication, authorization, and user management ready out of the box
- Learn Filament 5 - Demo cluster showcases forms, tables, widgets, actions, and infolists
- Production patterns - Policies, observers, services, and traits following Laravel best practices
- Modern stack - Latest versions of Laravel 13, Filament 5, Livewire 4, and Tailwind 4
Tech Stack
| Component | Version |
|---|---|
| PHP | 8.4 |
| Laravel | 13.x |
| Filament | 5.x |
| Livewire | 4.x |
| Tailwind CSS | 4.x |
| Pest | 4.x |
| PHPStan | Level 8 |
Features
Authentication & Authorization
- Filament Authentication - Login with session-based auth
- Role-Based Access Control - Granular permissions with hierarchical access levels
- Super Admin Role - Bypass all permission checks
- Policy-Based Authorization - Laravel policies for all resources
User Management
- User CRUD - Create, edit, delete users with role assignments
- User Status - Active/inactive status controls panel access
- Avatar Support - User profile images
- Blameable Records - Track who created/updated records
Activity Logging
- Audit Trail - Log all user actions automatically
- IP & User Agent - Capture request metadata
- Polymorphic Relations - Link logs to any model
- Login/Logout Tracking - Authentication events logged
Demo Showcase
- Form Inputs - All Filament input components
- Form Layouts - Sections, tabs, grids, wizards
- Tables - Columns, filters, actions, bulk actions
- Widgets - Stats, charts (line, bar, pie)
- Actions - Modal forms, confirmations, notifications
- Infolists - Read-only data display
Requirements
- PHP 8.4+
- Composer
- Node.js 20+ & pnpm
- SQLite (default) or MySQL/PostgreSQL
Installation
Using Laravel Installer (Recommended)
laravel new my-app --using=abitbt/filament
The installer will automatically set up everything for you.
Manual Installation
# Create project composer create-project abitbt/filament my-app cd my-app # Or clone the repository git clone https://github.com/abitbt/filament.git my-app cd my-app composer install # Setup pnpm install cp .env.example .env php artisan key:generate php artisan migrate --seed php artisan storage:link pnpm run build
storage:linkis required for user avatar uploads to render — they're stored understorage/avatars/and served via the public symlink.
Start Development Server
composer run dev
Access the admin panel at: http://localhost:8000/admin
Default Credentials
| Field | Value |
|---|---|
admin@example.com |
|
| Password | password |
Note: Change these credentials immediately in production environments.
Development Commands
# Development server with hot reload composer run dev # Code formatting ./vendor/bin/pint # Static analysis ./vendor/bin/phpstan analyse # Run all tests unset APP_ENV && php artisan test # Run specific test unset APP_ENV && php artisan test --filter=UserResourceTest
Project Structure
app/
├── Enums/
│ ├── Permission.php # Permission definitions with groups
│ ├── UserStatus.php # Active/Inactive status
│ └── ActivityEvent.php # Log event types
├── Filament/
│ ├── Clusters/Demo/ # Demo pages & widgets
│ ├── Pages/Dashboard.php # Main dashboard
│ ├── Resources/
│ │ ├── UserResource/ # User management
│ │ ├── RoleResource/ # Role management
│ │ └── ActivityLogResource/
│ └── Widgets/ # Dashboard widgets
├── Models/
│ ├── Concerns/
│ │ ├── Blamable.php # created_by/updated_by trait
│ │ └── HasPermissions.php # Permission checking trait
│ ├── User.php
│ ├── Role.php
│ ├── Permission.php
│ └── ActivityLog.php
├── Observers/ # Model event observers
├── Policies/ # Authorization policies
└── Services/
├── ActivityLogger.php # Logging service
└── PermissionRegistrar.php
Permission System
Permissions use a hierarchical access model:
| Level | Permission | Grants |
|---|---|---|
| 0 | None | No access |
| 1 | Read | View records |
| 2 | Write | Read + Create/Edit |
| 3 | Delete | Read + Write + Delete |
Available Permissions
| Group | Permissions |
|---|---|
| Users | users.read, users.write, users.delete |
| Roles | roles.read, roles.write, roles.delete |
| Activity Logs | activity_logs.read, activity_logs.delete |
Activity logs are system-generated and immutable — no
writepermission is exposed.
Adding New Permissions
- Add cases to
app/Enums/Permission.php - Update
getGroup()andgetGroupIcon()methods - Create a policy in
app/Policies/ - Run
php artisan db:seed --class=PermissionSeeder
Database Schema
users
├── id, name, email, password
├── avatar, status (enum)
├── role_id (foreign key)
├── created_by, updated_by (blameable)
└── timestamps
roles
├── id, name, slug, description
├── is_default (boolean)
└── timestamps
permissions
├── id, name, group, description
└── timestamps
role_permission (pivot)
├── role_id
└── permission_id
activity_logs
├── id, user_id
├── subject_type, subject_id (polymorphic)
├── event, description, properties (json)
├── ip_address, user_agent
└── created_at
Customization
Panel Configuration
Edit app/Providers/Filament/AdminPanelProvider.php:
return $panel ->brandName('Your App Name') ->colors(['primary' => Color::Blue]) ->path('admin') // Change URL path ->spa() // SPA mode (remove for traditional) ->sidebarCollapsibleOnDesktop();
Adding Resources
# Generate a new resource php artisan make:filament-resource Post --generate # Generate with soft deletes php artisan make:filament-resource Post --generate --soft-deletes
Adding Widgets
# Stats widget php artisan make:filament-widget PostStats --stats-overview # Chart widget php artisan make:filament-widget PostsChart --chart
Testing
Tests use Pest 4 and cover all resources:
# Run all tests unset APP_ENV && php artisan test # Run with coverage unset APP_ENV && php artisan test --coverage # Run specific test file unset APP_ENV && php artisan test tests/Feature/UserResourceTest.php
Contributing
- Fork the repository
- Create a feature branch
- Run
./vendor/bin/pintand./vendor/bin/phpstan analyse - Submit a pull request
License
This project is open-sourced software licensed under the MIT license.
abitbt/filament 适用场景与选型建议
abitbt/filament 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「admin-panel」 「rbac」 「starter-kit」 「livewire」 「filament」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 abitbt/filament 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 abitbt/filament 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 abitbt/filament 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Access management from UI
Alfabank REST API integration
Permission handling for lumen 6.x and up
Role-based Access Control: Roles, Permissions and ACL
Role based access control for Laravel 5+
A modern PHP starter kit with MVC.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-21