nunophp / style
A Laravel package to set up new projects with Nuno Maduro's recommended tools and configurations.
Fund package maintenance!
nunomaduro
Patreon
www.paypal.com/paypalme/enunomaduro
Requires
- php: ^8.3|^8.4
- illuminate/support: ^11
Requires (Dev)
- laravel/pint: ^1.18.1
- orchestra/testbench: ^9.0
- pestphp/pest: ^3.5.1
- pestphp/pest-plugin-type-coverage: ^3.1
- phpstan/phpstan: ^1.12.7
- rector/rector: ^1.2.8
- symfony/var-dumper: ^7.1.6
README
Nunophp Style is a Laravel package that sets up your project with Nuno Maduroβs recommended tools and configurations, including Pest, Pint, PHPStan, and Rector, all streamlined via a single Artisan command.
Requires PHP 8.3+
β‘οΈ Install the package into your Laravel project using Composer:
composer require nunophp/style --dev
The packageβs service provider (Nunophp\Style\StyleServiceProvider) will be auto-discovered by Laravel.
π Run the setup command to configure your project with Nunoβs recommended style:
php artisan style:setup
This command will:
- Prompt to install development tools (Pest, Pint, PHPStan, Rector).
- Update composer.json with modern testing scripts.
- Optionally update AppServiceProvider with recommended configurations.
- Publish configuration files (pint.json, phpstan.neon, rector.php), with overwrite prompts if they exist.
Example Commands After Setup
π§Ή Lint your codebase with Pint:
composer lint
β Refactor with Rector:
composer refacto
βοΈ Analyze with PHPStan:
composer test:types
β Test with Pest:
composer test:unit
π Run the full test suite:
composer test
Output Example
When you run php artisan style:setup
, expect a polished interface:
ββββββββββββββββββββββββββββββββββββββ
β Starting Nuno Style Setup β
ββββββββββββββββββββββββββββββββββββββ
Do you want to install required development tools? (Pest, Pint, PHPStan, Rector) [yes]:
> no
π Updating composer.json...
β composer.json updated with testing scripts.
Do you want to update AppServiceProvider with recommended configurations? This will replace your existing file. [yes]:
> no
π¦ Publishing configuration files...
β³ Skipped pint.json (not overwritten).
β Published phpstan.neon.
β³ Skipped rector.php (not overwritten).
ββββββββββββββββββββββββββββββββββββββ
β Nuno Style Setup Complete β
ββββββββββββββββββββββββββββββββββββββ
π Run "composer test" to verify your setup!
Contributing
Contributions are welcome! Please submit pull requests to the GitHub repository.
Nunophp Style was created by Micheal Ataklt under the MIT license.