tomasvotruba/bladestan
Bladestan adds PHPStan-powered static analysis for Laravel Blade templates. Install as a dev dependency and include its extension if needed. Provides a custom “blade” error formatter showing clickable template paths and where errors are rendered.
Static analysis for Blade templates in Laravel projects.
composer require tomasvotruba/bladestan --dev
If you run PHPStan with its extension installer, Bladestan will just work, if not you need to include it in the phpstan.neon configuration file:
includes:
- ./vendor/tomasvotruba/bladestan/config/extension.neon
We provide custom PHPStan error formatter to better display the template errors:
------ -----------------------------------------------------------
Line app/Http/Controllers/PostCodexController.php
------ -----------------------------------------------------------
20 Call to an undefined method App\Entity\Post::getContent().
rendered in: post_codex.blade.php:15
------ -----------------------------------------------------------
How to use custom error formatter?
vendor/bin/phpstan analyze --error-format=blade
How can I help you explore Laravel packages today?