| Install | |
|---|---|
composer require owlfice/citadel |
|
| Latest Version: | v1.0.0 |
| PHP: | ^8.2 |
| License: | MIT |
| Last Updated: | Jul 30, 2025 |
| Links: | GitHub · Packagist |
🚀 Production-Ready Laravel Backend Boilerplate
Built with Laravel 12, PHP 8.2+, and modern development practices
Citadel is a production-ready Laravel backend boilerplate designed to accelerate your web application development. Built with Laravel 12 and modern PHP 8.2+, it provides a robust foundation with enterprise-grade features including OAuth2 authentication, role-based permissions, media management, and full-text search capabilities.
Get Citadel running in 5 minutes! See QUICKSTART.md for detailed instructions.
Current version: {{ app_version() }}
GET /api/version for version informationscripts/ci-switch.sh to switch between platforms# Code formatting
composer run pint
# Static analysis
composer run analyse
# Run tests
composer run test
# All quality checks
composer run quality
# Development server with hot reload
composer run dev
git clone <repository-url> citadel
cd citadel
docker-compose up -d
# Create your first super admin user
docker-compose exec app php artisan citadel:create-super-admin \
--email=admin@yourcompany.com \
--password=SecurePassword123! \
--name="Admin User"
🌐 Access: http://localhost:8000
git clone <repository-url> citadel
cd citadel
composer install && npm install
cp .env.example .env && php artisan key:generate
php artisan migrate && php artisan passport:install
# Create your first super admin user
php artisan citadel:create-super-admin \
--email=admin@yourcompany.com \
--password=SecurePassword123! \
--name="Admin User"
composer run dev
🌐 Access: http://localhost:8000
git clone <repository-url> citadel
cd citadel
./vendor/bin/sail up -d
# Create your first super admin user
./vendor/bin/sail artisan citadel:create-super-admin \
--email=admin@yourcompany.com \
--password=SecurePassword123! \
--name="Admin User"
🌐 Access: http://localhost
users.*, media.*)Citadel includes a powerful interactive command for creating super admin users:
# Interactive mode with confirmation prompts
php artisan citadel:create-super-admin
# Direct mode with parameters
php artisan citadel:create-super-admin \
--email=admin@example.com \
--password=SecurePassword123! \
--name="Super Admin"
# Docker environment
docker-compose exec app php artisan citadel:create-super-admin \
--email=admin@example.com \
--password=SecurePassword123! \
--name="Super Admin"
Features:
?filter[name]=john&sort=-created_at&include=roles?fields[users]=id,name,email for optimized responses| Component | Technology | Purpose |
|---|---|---|
| Framework | Laravel 12 | Backend foundation |
| Authentication | Laravel Passport | OAuth2 server |
| Permissions | Spatie Permission | Role-based access control |
| Media | Spatie Medialibrary | File management |
| Search | Laravel Scout | Full-text search |
| API Queries | Spatie Query Builder | Flexible API filtering |
| Testing | Pest PHP | Modern testing framework |
| Frontend | Tailwind CSS + Vite | Modern UI development |
| Cache/Queue | Redis | High-performance data store |
| Database | MySQL/PostgreSQL/SQLite | Flexible database support |
app/Http/Controllers/Api/
├── AuthController.php # Authentication endpoints
├── UserController.php # User management with QueryBuilder
├── MediaController.php # File upload and management
├── SearchController.php # Full-text search functionality
└── ApiDocumentationController.php # API documentation
app/Console/Commands/
├── SuperAdminCreation.php # Interactive super admin creation command
└── GetRoleList.php # Role management and statistics command
├── README.md # Project overview and quick start
├── QUICKSTART.md # 5-minute setup guide
├── DOCKER.md # Docker development guide
├── COMMANDS.md # Artisan commands reference
├── DEPLOYMENT.md # Production deployment guide
├── SEMANTIC_VERSIONING.md # Semantic versioning with GitLab CI/CD
├── GITHUB_ACTIONS.md # GitHub Actions CI/CD setup
├── CHANGELOG.md # Version history and changes
└── CONTRIBUTING.md # Contribution guidelines
config/citadel.php - Centralized configurationapp/helpers.php - Helper functions with autoloading.env.citadel.example - Environment variable examplesCitadel supports both GitLab CI/CD and GitHub Actions with identical functionality:
.gitlab-ci.yml.releaserc.json.github/workflows/ci-cd.yml.releaserc.github.json# Switch to GitLab CI/CD
./scripts/ci-switch.sh gitlab
# Switch to GitHub Actions
./scripts/ci-switch.sh github
# Check current status
./scripts/ci-switch.sh status
Both platforms use conventional commits for automatic version management:
feat: add new feature # Minor version bump (1.0.0 → 1.1.0)
fix: resolve bug # Patch version bump (1.0.0 → 1.0.1)
feat!: breaking change # Major version bump (1.0.0 → 2.0.0)
# Create a new super admin user (interactive)
php artisan citadel:create-super-admin
# Create super admin with parameters
php artisan citadel:create-super-admin --email=admin@example.com --password=SecurePass123! --name="Admin"
# View all available citadel commands
php artisan list citadel
# Generate API documentation
php artisan scramble:generate
# Clear all caches
php artisan optimize:clear
# Run tests
./vendor/bin/pest
# Run code analysis
./vendor/bin/phpstan analyse
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is open-sourced software licensed under the MIT license.