Description
Adds code analysis to Laravel improving developer productivity and code quality
Create a phpstan.neon or phpstan.neon.dist file in the root of your application. It might look like this:
includes: - vendor/larastan/larastan/extension.neon - vendor/nesbot/carbon/extension.neon parameters: paths: - app/ # Level 10 is the highest level level: 5 # ignoreErrors:# - '#PHPDoc tag @var#'## excludePaths:# - ./*/*/FileToBeExcluded.php
For all available options, please take a look at the PHPStan documentation: https://phpstan.org/config-reference
You may start analyzing your code using the phpstan console command:
./vendor/bin/phpstan analyse
If you are getting the error Allowed memory size exhausted, then you can use the --memory-limit option fix the problem:
./vendor/bin/phpstan analyse --memory-limit=2G
Related Content on Laravel Daily
Video
Video
Recent Courses on Laravel Daily
AI Agents/IDEs for Laravel: May 2026 (Claude Code, Codex, OpenCode, etc)
7 lessons
52 min
How to Build Laravel 13 API From Scratch
30 lessons
1 h 23 min
How to Structure Laravel 13 Projects
16 lessons
1 h 32 min read