tomasvotruba/bladestan

PHPStan rule for static analysis of Blade templates

Package info

github.com/bladestan/bladestan

Type:phpstan-extension

pkg:composer/tomasvotruba/bladestan

Statistics

Installs: 722 029

Dependents: 15

Suggesters: 1

Stars: 368

Open Issues: 16

0.11.5 2026-03-16 16:17 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 279538d6e56298897378534b3eb9b3bfca32a37b

static analysisphpstan-extension


README

👁 codecov

Bladestan

Static analysis for Blade templates in Laravel projects.

Install

composer require tomasvotruba/bladestan --dev

Configure

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

Features

Custom Error Formatter

We provide custom PHPStan error formatter to better display the template errors:

  • clickable template file path link to the error in blade template
 ------ -----------------------------------------------------------
 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

Credits