stillat/blade-parser
Parse, analyze, and transform Laravel Blade templates with a robust PHP parser. stillat/blade-parser provides an AST, tokenization, and utilities to inspect directives, components, and expressions—ideal for linters, formatters, editors, and automated refactoring tools.
Architecture fit: The package is purpose-built for Laravel's templating ecosystem, offering non-executing Blade analysis that aligns with Laravel's component-based design. It avoids runtime dependencies, making it suitable for tooling layers without affecting application performance.
Integration feasibility: High for Composer-based Laravel projects. Minimal boilerplate required to integrate, but requires careful handling of Blade version compatibility and edge cases like custom directives or legacy syntax.
Technical risk: Critical concerns include unknown repository (no public source code for audit), low community adoption (144 stars), and a future-dated release (2026-02-26) suggesting potential data inaccuracies. Likely compatibility gaps with newer Laravel versions due to sparse maintenance history.
Key questions:
Stack fit: Native compatibility with PHP/Laravel stacks. Ideal for embedding in CLI tools, IDE plugins, or CI pipelines where static analysis of Blade templates is required. Does not interfere with runtime execution or middleware layers.
Migration path: Replace regex-based parsing or ad-hoc string manipulation with structured node traversal. Start by parsing a subset of templates (e.g., error pages) to validate accuracy before scaling to full codebase.
Compatibility: Must validate against current Laravel version's Blade implementation. Known limitations may exist for newer features like @once or component slots if the parser hasn't been updated recently.
Sequencing:
Maintenance: High risk due to low community engagement and unverifiable repository. Internal team would need to maintain a fork if critical bugs emerge. No SLA or official support channels.
Support: Entirely community-dependent. Lack of issue tracker or contribution guidelines (due to unknown repo) makes troubleshooting difficult. Requires internal expertise to debug parser failures.
Scaling: Parsing thousands of templates may require batching due to memory constraints. No documented performance benchmarks—must test with production-scale template volumes.
Failure modes: Unhandled Blade syntax (e.g., custom directives) could cause parser crashes. No built-in fallback for malformed templates, risking pipeline failures during CI.
Ramp-up: Moderate learning curve for developers unfamiliar with AST traversal. Documentation appears sparse—requires studying source code directly (if accessible) to understand node types and traversal patterns.
How can I help you explore Laravel packages today?