tomasvotruba/bladestan
Bladestan brings PHPStan-powered static analysis to Laravel Blade templates. It catches template-related issues during analysis and offers a Blade error formatter with clickable template paths and “rendered in” context for faster debugging.
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?