Toolbox full of useful packages to keep your Laravel project compliant with your coding standards.
It provides a minimum configuration to help you start with static analysis, code styling and testing.
- Laravel Debugbar
- Laravel Ide Helper
- Analyzer
- Infection
- Phpunit SpeedTrap
- Laravel Dusk
- Laravel Sail
- Larastan
- Pest
- Phpunit
- Rector
- Security Advisories
- Laravel Ray
Hey folks,
Do you like this package? Do you find it useful, and it fits well in your project?
I am glad to help you, and I would be so grateful if you considered supporting my work.
You can even choose π:
- You can sponsor me π with a monthly subscription.
- You can buy me a coffee β or a pizza π just for this package.
- You can plant trees π΄. By using this link we will both receive 30 trees for free and the planet (and me) will thank you.
- You can "Star β" this repository (it's free π).
Install the package via composer:
composer require lemaur/toolbox --dev if you still using php8.0 you should use:
composer require "lemaur/toolbox:^3.2" --devLaunch the installation:
Be careful, this package was created to be used on a fresh new Laravel project.
Commands listed below will OVERWRITE your existing files!
If you install this package in a fresh Laravel installation, you can simply run:
php artisan toolbox:installβ¬οΈ configure only Pest and Dusk test suites. Those files will be overwritten.
php artisan toolbox:install --test-suitesOtherwise, you can install only the group of files you need without test suites:
β¬οΈ will overwrite phpstan.neon.
php artisan toolbox:install --only="static-analysis"or you can specify multiple values, β¬οΈ will overwrite phpstan.neon and pint.json.
php artisan toolbox:install --only="static-analysis" --only="code-style"Available values for the --only option:
- static-analysis
- code-style
- refactor
- tests
- commonAdd those scripts to your composer.json:
"scripts": {
"ide-helper": [
"@php artisan ide-helper:models --write-mixin --reset",
"@php artisan ide-helper:generate",
"@php artisan ide-helper:eloquent",
"@php artisan ide-helper:meta"
],
"analyse": "./vendor/bin/phpstan analyse --memory-limit=2G",
"refactor": "./vendor/bin/rector process --memory-limit=2G",
"format": "./vendor/bin/pint",
"test": "./vendor/bin/pest --exclude-group=e2e",
"test:fast": "./vendor/bin/pest --exclude-group=e2e --parallel",
"test:coverage": "./vendor/bin/pest --exclude-group=e2e --coverage --min=50 --coverage-html=.coverage --coverage-clover=coverage.xml",
"test:e2e": "@php artisan pest:dusk",
"test:mutation": [
"Composer\\Config::disableProcessTimeout",
"XDEBUG_MODE=coverage vendor/bin/infection --show-mutations --threads=4 --only-covering-test-cases --min-msi=25 --min-covered-msi=85 --test-framework=pest --test-framework-options='--configuration=phpunit.xml --exclude-group=e2e'"
]
}Allow plugins to be executed by Composer, by putting these lines on composer.json:
"config": {
...
"allow-plugins": {
"phpstan/extension-installer": true,
"pestphp/pest-plugin": true,
"infection/extension-installer": true
}
}Generate PHPDoc for your models and
other (helpful for your IDE and static analysis tools) for more info
composer ide-helpersRun code refactoring for more info
composer refactorRun code style formatting for more info
composer formatRun static analysis for more info
composer analyseRun tests for more info
composer testRun tests with coverage for more info
composer test:coverageRun e2e tests for more info
composer test:e2eRun mutation tests for more info
composer test:mutationPlease see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.