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" --dev
Launch 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-suites
Otherwise, 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
- common
Add 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-helpers
Run code refactoring for more info
composer refactor
Run code style formatting for more info
composer format
Run static analysis for more info
composer analyse
Run tests for more info
composer test
Run tests with coverage for more info
composer test:coverage
Run e2e tests for more info
composer test:e2e
Run mutation tests for more info
composer test:mutation
Please 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.