A modern, production-ready starter kit built with FilamentPHP v4, Laravel 12, and essential packages for building robust admin panels. This starter comes pre-configured with role-based access control and dynamic menu management.
- 🎨 FilamentPHP v4 - The latest version of the elegant admin panel framework
- 🔐 Filament Shield - Complete role and permission management with auto-discovery
- 📋 Menu Management - Dynamic navigation builder with role-based visibility
- 🛡️ Spatie Permission - Robust role and permission handling
- ⚡ Laravel 12 - Latest Laravel framework with modern PHP 8.2+ features
- 🎯 Production Ready - Pre-configured and optimized for deployment
| Package | Version | Description |
|---|---|---|
| filament/filament | ^4.0 | Admin panel framework |
| bezhansalleh/filament-shield | ^4.0 | Role & permission management |
| spatie/laravel-permission | ^6.0 | Backend for roles & permissions |
- PHP >= 8.2
- Composer
- Node.js & NPM
- MySQL / PostgreSQL / SQLite
-
Clone the repository
git clone https://github.com/saifulcoder/filament-starter.git cd filament-starter -
Run Setup Script
composer setup
This will:
- Install Composer dependencies
- Copy
.env.exampleto.env - Generate application key
- Run database migrations
- Install NPM dependencies
- Build assets
-
Configure your database in
.env:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=filament_starter DB_USERNAME=root DB_PASSWORD=
-
Setup Filament Shield (Roles & Permissions):
php artisan shield:setup php artisan shield:generate --all php artisan shield:super-admin
-
Access the Admin Panel
Visit:
http://your-domain/admin
Start the development server with all essential services:
composer devThis command runs concurrently:
- 🌐 Laravel development server
- 📬 Queue listener
- 📝 Laravel Pail (log viewer)
- ⚡ Vite development server
The starter includes a complete Navigation Management system that allows you to:
- ✅ Create multiple navigation menus
- ✅ Add menu items with labels and URLs
- ✅ Configure link targets (same tab / new tab)
- ✅ Set role-based visibility for each menu item
- ✅ Create nested sub-menus
- ✅ Reorder items with drag & drop
use App\Models\Navigation;
// Get navigation by handle
$mainMenu = Navigation::where('handle', 'main-menu')->first();
// Access menu items
foreach ($mainMenu->items as $item) {
echo $item['label'];
echo $item['url'];
}Shield provides automatic permission discovery and generation for all Filament resources:
# Generate permissions for all resources
php artisan shield:generate --all
# Generate for specific resource
php artisan shield:generate --resource=UserResourcephp artisan shield:super-admin├── app/
│ ├── Filament/
│ │ └── Resources/
│ │ └── NavigationResource.php # Menu management
│ ├── Models/
│ │ ├── Navigation.php # Navigation model
│ │ └── User.php # User with HasRoles trait
│ ├── Policies/
│ └── Providers/
├── config/
│ ├── filament.php # Filament configuration
│ ├── filament-shield.php # Shield configuration
│ └── permission.php # Spatie Permission config
├── database/
│ └── migrations/
│ ├── create_permission_tables.php # Spatie permissions
│ └── create_navigations_table.php # Menu management
└── resources/
Configure Shield settings in config/filament-shield.php:
return [
'super_admin' => [
'enabled' => true,
'name' => 'super_admin',
],
// ...
];When you create a new Filament resource, generate its permissions:
php artisan make:filament-resource Post
php artisan shield:generate --resource=PostResourceRun tests with:
composer test| Command | Description |
|---|---|
composer setup |
Complete project setup |
composer dev |
Start development servers |
composer test |
Run tests |
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open-sourced software licensed under the MIT license.
This project helps you and you want to help keep it going? Buy me a coffee:
or via
https://saweria.co/saifulcoder
Made with ❤️ using FilamentPHP and Laravel
