Scripts that we add to the composer.json file of all of our projects including lint, stan, and ready
$0.00
This recipe is compatible with any Laravel app running version 12.0 and above, regardless of choice of starter pack.
In all of our apps, we run Pint, PHPStan, and Pest via GitHub Actions in CI. When code is merged into main, it is automatically deployed to production if all of those checks pass. In order to ensure that we don't gum up our CI with linting errors, failing tests, or PHPStan errors, we have composer scripts that provide shortcuts to make running these very easy.
composer lint
runs Pint, using our pint.json
file. When you install this recipe, we'll add our pint.json
file
if you don't have one. You can feel free to edit this file to suit your preferences or simply delete it to always use
Pint's defaults.
composer stan
runs PHPStan. Our PHPStan is set to level 5, and we use the Larastan plugin to help the static analyzer
understand some of Laravel's more opaque parts. When you install this recipe, we'll install our own phpstan.neon
file
if you don't already have your own. If you do have one and it doesn't use Larastan, we'll add Larastan to improve your
PHPStan experience.
composer test
runs the test suite. In our case, it's Pest, but this script simply runs php artisan test
, so if you
chose PHPUnit as your test runner, it will work fine out of the box.
composer ready
runs all three of these checks. We always run this before pushing any code up. Our internal policy is
that we never mark any PR as ready for review until all of these checks are passing.
124 ratings
[]
[]
Lorem ipsum dolor sit amet consectetur adipisicing elit.