New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

stillat/blade-parser

2,914,226 148

Larablocks Analysis

stillat/blade-parser works with Laravel 10 to 13 (latest release v2.1.0, Feb 26, 2026).

Laravel 8 and 9 in earlier releases.

Recommendation checks

Recommended

Recommended by Larablocks: meets all 4 checks.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Feb 26, 2026)
  • 426,429 downloads a month (at least 10,000)
  • 148 GitHub stars (at least 100)

State

Maintained
  • Last stable release: Feb 26, 2026.
  • 1 release in the last 12 months.
  • First released: Nov 18, 2022.
  • Monthly downloads: 426,429, up 221% from six months ago.
  • 1 open issue on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require stillat/blade-parser
Latest Version:v2.1.0
PHP:^8.2.0
Laravel:10 – 13
Older releases:8 · 9
License:MIT
Last Updated:Feb 26, 2026
Links: GitHub  ·  Packagist
Maintainer: stillat

Blade Parser is library for Laravel that makes it easy to parse, analyze, and manipulate Blade templates.

The library is composed of many major components:

  • Parser: A Blade parser that produces a list of nodes, which can be analyzed to help make decisions surrounding a template.
  • Documents: A powerful abstraction that makes it much simpler to interact with the details of a single parsed Blade template.
  • Workspaces: A simple set of APIs that make it effortless to work with multiple parsed Blade templates at once.
  • Compiler: A highly configurable Blade compiler implementation, with support for precompilers, extensions, and existing third-party packages.
  • Validator: An extensible system for validating Blade documents, with default validators capable of detecting unpaired conditions, invalid component parameter spacing, and much more.

Simple to Use

Parsing Blade templates is incredibly simple using the Documents API. As an example, this is all that is needed to parse a template:

<?php
 
use Stillat\BladeParser\Document\Document;
 
$template = <<<'BLADE'
    Hello, {{ $world }}
BLADE;
 
$document = Document::fromText($template);

The Document class provides a powerful abstraction, making it simple to quickly retrieve information about a template.

For instance, if we wanted to extract all the components from our template we could do this:

<?php

// Do something with all component tags in the template.
$document->getComponents()
          ->each(fn($node) => ...);

If we were only interested in a component named alert, we could instead use:

<?php

// Find all "alert" components.
$document->findComponentsByTagName('alert')
         ->each(fn($node) => ...);

These examples hardly scratch the surface, and you are encouraged to read through the Documentation.

Built-in Validation Command

This library also ships with a configurable blade:validate Artisan command which can be used to validate all Blade templates within a project.

To configure the command, you will need to publish its configuration files using the following command:

php artisan vendor:publish --tag=blade

To run the validation against your project, you can issue the following Artisan command:

php artisan blade:validate

If any validation issues were detected they will be displayed in your terminal.

There are many configuration options available, and if you'd like to learn more you can find them documented in the Configuring the Validate Command article.

License

This parser library is open-sourced software licensed under the MIT license.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

465,816,364 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

431,187,642 4,660

Version History

Version Released PHP Laravel License
v2.1.0 ^8.2.0 ^10.0 || ^11.0 || ^12.0 || ^13.0 MIT
v2.0.0 ^8.2.0 ^10.0 || ^11.0 || ^12.0 MIT
v1.10.3 ^8.1.0 ^9.36 || ^10.0 || ^11.0 MIT
v1.10.2 ^8.1.0 ^9.36 || ^10.0 || ^11.0 MIT
v1.10.1 ^8.1.0 ^9.36 || ^10.0 || ^11.0