Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Bladestan Laravel Package

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.

View on GitHub
Deep Wiki
Context7

PHPStan rule for static analysis of Blade templates

Frequently asked questions about Bladestan
How do I install Bladestan for Laravel Blade static analysis?
Run `composer require tomasvotruba/bladestan --dev` to add it as a development dependency. If using PHPStan’s extension installer, it auto-configures. Otherwise, include the provided `extension.neon` in your `phpstan.neon` file under the `includes` section.
Does Bladestan work with Laravel 10, 11, or 12?
Yes, Bladestan is actively maintained for Laravel 10+ and supports PHP 8.1+. It also works with Livewire 3/4. Check the GitHub repo for version-specific updates, as newer Laravel releases may require minor adjustments.
What types of Blade issues does Bladestan detect?
It catches undefined methods, missing variables, invalid directives (e.g., `@include` with wrong parameters), and Livewire prop mismatches. The custom `--error-format=blade` flag highlights where errors render in `.blade.php` files with clickable line numbers.
Can I use Bladestan in CI/CD pipelines?
Absolutely. Bladestan is designed for CI/CD—add it to your GitHub Actions, GitLab CI, or other pipelines. Run `phpstan analyze --error-format=blade` in your test stage to catch Blade issues before deployment. It’s zero-overhead in production.
How do I handle false positives in dynamic Blade templates?
Blade’s dynamic nature (e.g., `@php` blocks) may trigger false positives. Start by running Bladestan on high-risk templates, then tweak `phpstan.neon` to ignore known issues. The package includes a `Livewire` section for dynamic component validation.
Does Bladestan support custom Blade paths (e.g., package views)?
Yes, but you may need to configure Laravel’s `view.paths()` to include non-standard paths. Bladestan respects Laravel’s view resolution system. Test path coverage early by running it against your custom paths before full integration.
What’s the difference between `--error-format=blade` and default PHPStan output?
The `--error-format=blade` flag provides Blade-specific context, like showing *which Blade template* renders the error (e.g., `post_codex.blade.php:15`) and clickable file links. Default output lacks this template-aware detail, making debugging slower.
Can Bladestan validate Livewire component props?
Yes, it validates Livewire props, dynamic components, and shared data. For complex props (e.g., nested objects), you might need to adjust PHPStan’s `Livewire` rules in `extension.neon`. Test with representative components first.
Will Bladestan slow down my Laravel app in production?
No, Bladestan is a *static analysis* tool—it runs during development or CI, not in production. It has zero runtime overhead and integrates with PHPStan’s caching for fast repeated runs.
Are there alternatives to Bladestan for Blade static analysis?
Few tools specialize in Blade static analysis. Alternatives include generic PHPStan rules (less Blade-aware) or manual QA. Bladestan stands out for its Laravel-centric features (Livewire support, custom error formatting) and active maintenance.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai