marekmiklusek / laraboost
A package that automatically apply common Laravel configurations, development tools and more...
Requires
- php: ^8.3.0
- laravel/framework: ^12.10.1
Requires (Dev)
- larastan/larastan: ^3.3.1
- laravel/pint: ^1.22.0
- rector/rector: ^2.0.11
README
๐ Quick Application Bootstrapping
Tired of adding the same configuration code to every new Laravel project? This package automatically applies best practice configurations and installs essential development tools with a single command.
โจ Features
- ๐ Automatically applies common Laravel configurations
- ๐งฐ Installs essential dev tools (Debugbar, Larastan, Rector)
- ๐ Creates pre-configured tool settings files
- ๐ ๏ธ Provides helpful artisan commands
- โก Optimizes DB access with destructive command protection
- ๐ Configures Carbon for immutable dates
- ๐ Sets up strict model usage with automatic eager loading
- ๐ Enforces HTTPS in production
- ๐ Configures Vite with aggressive prefetching
๐ Requirements
- PHP 8.3+
- Laravel 12+
๐ฆ Installation
composer require marekmiklusek/laraboost
๐ง Usage
Automatic Configuration
Once installed, the package will automatically apply all configurations:
- DB destructive command protection in production
- Carbon immutable dates
- Strict model usage with automatic eager loading
- HTTPS enforcement in production
- Vite with aggressive prefetching
Installing Development Tools
Run the following command to install development tools:
php artisan install:dev-tools
This command will install the following packages via Composer:
- Laravel Debugbar
- Larastan (PHPStan for Laravel)
- Rector (PHP refactoring tool)
It will also create the following configuration files in your project root:
pint.json
- Laravel Pint configurationphpstan.neon
- Larastan configurationrector.php
- Rector configuration
Creating Action Classes
Generate new action classes using the provided Artisan command:
php artisan make:action CreateTodoAction
This will create a new action class with the following structure:
<?php declare(strict_types=1); namespace App\Actions; use Illuminate\Support\Facades\DB; final readonly class CreateTodoAction { /** * Execute the action. */ public function execute(): void { DB::transaction(function (): void { // }); } }
๐ป Configuration Details
Applied Configurations
// Database commands DB::prohibitDestructiveCommands(app()->isProduction()); // Date handling Date::use(CarbonImmutable::class); // Model configurations Model::automaticallyEagerLoadRelationships(); Model::unguard(); Model::shouldBeStrict(); // URL handling URL::forceHttps(app()->isProduction()); // Vite configuration Vite::useAggressivePrefetching();
๐งช Development Tools
Laravel Debugbar
A package that adds a debugging bar at the bottom of your pages during development, providing valuable information about queries, views, routes, and more.
Larastan
A PHPStan wrapper for Laravel that provides static analysis for your Laravel application code.
Rector
A tool for automated refactoring and upgrades of your PHP code.
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
The MIT License (MIT). Please see License File for more information.