patressz / laravel-essentials
Patressz Essentials
Requires
- php: ^8.3|^8.4
- illuminate/console: ^11.0|^12.0
- illuminate/support: ^11.0|^12.0
Requires (Dev)
- laravel/pint: ^1.22.1
- orchestra/testbench: ^10.4
- peckphp/peck: ^0.1.3
- pestphp/pest: ^4.0.0
- pestphp/pest-plugin-type-coverage: ^4.0.0
- phpstan/phpstan: ^2.1.16
- rector/rector: ^2.0
- symfony/var-dumper: ^7.2.6
README
Laravel Essentials is a Laravel package that streamlines the setup of essential development tools and applies Laravel best practices to your application. It provides an interactive installation command that sets up code quality tools and configures your AppServiceProvider with production-ready optimizations.
Requires PHP 8.3+ and Laravel 11+
Installation
Install the package via Composer:
composer require patressz/laravel-essentials --dev
Usage
Run the installation command to set up your Laravel project with essential tools and configurations:
php artisan essentials:install
What it does
The installation command will:
-
Install Development Tools (interactive selection):
- Laravel Pint - Code style fixer
- PHPStan (Larastan) - Static analysis tool
- Rector - PHP automated refactoring tool
-
Configure AppServiceProvider with Laravel best practices:
- Model Strictness - Enforce strict model behavior in production
- Model Unguarded - Disable mass assignment protection globally
- Automatic Eager Loading - Prevent N+1 queries in development
- Date Configuration - Use Carbon Immutable by default
- Command Safety - Prohibit destructive commands in production
- HTTPS Enforcement - Force HTTPS scheme in production
- Asset Prefetching - Enable Vite asset prefetching
Command Options
# Skip confirmation prompts and overwrite existing files
php artisan essentials:install --yes
Development Tools
After installation, you can use these commands for code quality:
🧹 Code Style Fixing with Pint:
./vendor/bin/pint
⚗️ Static Analysis with PHPStan:
./vendor/bin/phpstan
🔧 Code Refactoring with Rector:
./vendor/bin/rector
Configuration Files
The package will create configuration files for the selected tools:
pint.json
- Laravel Pint configurationphpstan.neon
- PHPStan configuration with Laravel rulesrector.php
- Rector configuration with Laravel-specific rules
Requirements
- PHP 8.3 or higher
- Laravel 11.0 or higher
License
Laravel Essentials was created by Patrik Strišovský under the MIT license.