akira / setup
Interactive Laravel project setup command with best practices, testing tools, and CI/CD workflows
Fund package maintenance!
kidiatoliny
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/akira/setup
Requires
- php: ^8.4
- illuminate/console: ^12.0
- illuminate/support: ^12.0
- symfony/process: ^7.0
Requires (Dev)
- akira/laravel-debugger: v1.3.1
- driftingly/rector-laravel: ^2.1
- larastan/larastan: ^3.8
- laravel/pint: ^1.18
- mockery/mockery: ^1.6
- nunomaduro/collision: ^8.5
- orchestra/testbench: ^10.0
- peckphp/peck: ^0.2
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- pestphp/pest-plugin-type-coverage: ^4.0.3
- rector/rector: ^2.0
README
An interactive Laravel package installer that sets up your project with best practices, testing tools, code quality standards, and CI/CD workflows in seconds.
Features
Interactive Setup - Beautiful CLI interface using Laravel Prompts
Smart Package Management - Automatically installs PHP and Node.js packages
Auto-Detection - Detects your preferred Node package manager (npm, pnpm, yarn, bun)
️ Configuration Files - Generates Laravel Pint, Rector, and Release-It configs
GitHub Actions - Installs pre-configured CI/CD workflows
Composer Scripts - Adds convenient testing and linting scripts
Fully Typed - PHP 8.4 with strict types and modern features
Tested - Comes with Pest tests
Requirements
- PHP 8.4+
- Laravel 12+
- Composer 2+
Installation
Install the package via Composer:
composer require --dev akira/setup
The package will automatically register itself via Laravel's package auto-discovery.
Usage
Run the interactive setup command:
php artisan akira:setup
The command will guide you through:
- Select PHP Packages - Choose from essential Laravel packages
- Select Dev Packages - Pick testing and code quality tools
- Select Node Packages - Choose release management tools
- Package Manager - Select npm, pnpm, yarn, or bun
- GitHub Workflows - Optionally install CI/CD pipelines
What Gets Installed
PHP Packages (require)
nunomaduro/essentials- Essential Laravel helpersakira/laravel-auth-logs- Authentication logging
PHP Packages (require-dev)
akira/laravel-debugger- Enhanced debugging toolsdriftingly/rector-laravel- Laravel-specific Rector rulesfakerphp/faker- Fake data generatorlarastan/larastan- PHPStan for Laravellaravel/boost- Laravel performance optimizerlaravel/pail- Log viewerlaravel/pint- Code style fixermockery/mockery- Mocking frameworknunomaduro/collision- Error handlerpestphp/pest- Testing frameworkpestphp/pest-plugin-browser- Browser testingpestphp/pest-plugin-laravel- Laravel supportpestphp/pest-plugin-type-coverage- Type coveragerector/rector- PHP refactoring toolroave/security-advisories- Security vulnerability scanner
Node.js Packages (devDependencies)
release-it- Release management tool@commitlint/cli- Commit message linter@commitlint/config-conventional- Conventional commits config@release-it/conventional-changelog- Changelog generator
Configuration Files
pint.json
Laravel Pint configuration with comprehensive rules for:
- Strict typing
- Modern PHP 8.4 features
- Final classes
- Readonly properties
- Type declarations
- Code quality standards
rector.php
Rector configuration with:
- PHP 8.4 upgrade rules
- Laravel 12 compatibility
- Code quality improvements
- Type declaration automation
- Dead code removal
- Privatization rules
.release-it.json
Release-It configuration for:
- Semantic versioning
- Conventional changelog generation
- Automatic GitHub releases
- Git tag management
Composer Scripts
The following scripts are added/merged into composer.json:
{
"scripts": {
"lint": [
"rector",
"pint --parallel",
"npm run lint"
],
"test:type-coverage": "pest --type-coverage --min=100",
"test:lint": [
"pint --parallel --test",
"rector --dry-run",
"npm run test:lint"
],
"test:unit": "pest --parallel --coverage --exactly=100.0",
"test:types": [
"phpstan",
"npm run test:types"
],
"test": [
"@test:type-coverage",
"@test:unit",
"@test:lint",
"@test:types"
]
}
}
Package.json Scripts
{
"scripts": {
"release": "release-it"
}
}
GitHub Actions Workflows
.github/workflows/tests.yml
Comprehensive testing pipeline with:
- PHP 8.4 test matrix
- Laravel 12 compatibility
- Multiple OS support
- Code quality checks
- Static analysis with PHPStan
.github/workflows/release-discord.yml
Automatic Discord notifications for new releases with:
- Release version
- Release notes
- Repository link
- Timestamp
Usage Examples
Running Tests
# Run all tests with type coverage, unit tests, linting, and type checking composer test # Run only unit tests composer test:unit # Run only type coverage composer test:type-coverage # Run only linting composer test:lint # Run only type checking composer test:types
Code Quality
# Auto-fix code style and refactor composer lint # Check code style without fixing pint --test # Run Rector dry-run rector --dry-run
Creating Releases
# Interactive release (follows semantic versioning) npm run release # Specific version npm run release -- --increment patch npm run release -- --increment minor npm run release -- --increment major
Architecture
The package follows Spatie-level quality standards:
- Action Pattern - Business logic isolated in action classes
- DTOs - Data Transfer Objects for complex data structures
- Service Provider - Auto-discovery for seamless integration
- Dependency Injection - No facades, pure DI
- Strict Typing - PHP 8.4 with
strict_types=1 - Final Classes - Immutability where appropriate
- Readonly Properties - Modern PHP features
- No Static Calls - Testable, maintainable code
Package Structure
akira/setup/
├── src/
│ ├── Console/
│ │ └── SetupCommand.php # Main interactive command
│ ├── Actions/
│ │ ├── InstallPhpPackagesAction.php
│ │ ├── InstallNodePackagesAction.php
│ │ ├── PublishConfigFilesAction.php
│ │ └── PublishWorkflowsAction.php
│ ├── DTOs/
│ │ ├── PackageSelection.php
│ │ └── ComposerScripts.php
│ ├── Support/
│ │ ├── PackageDetector.php # Package manager detection
│ │ └── FileManager.php # File operations
│ └── AkiraSetupServiceProvider.php
├── stubs/
│ ├── pint.json
│ ├── rector.php
│ ├── release-it.json
│ └── github/
│ ├── release-discord.yml
│ └── tests.yml
└── tests/
├── Feature/
│ └── SetupCommandTest.php
└── Unit/
├── PackageDetectorTest.php
└── ComposerScriptsTest.php
Testing
Run the package tests:
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.