1.2.0
This release introduces a new onlyParseComponents method to the DocumentParser class, allowing users to only parse components within an input template:
<?php
use Stillat\BladeParser\Parser\DocumentParser;
use Stillat\BladeParser\Document\Document;
$parser = new DocumentParser;
$template = <<<'BLADE'
<x-alert>
{{ $title }} @if ($this) @endif
</x-alert>
BLADE;
// Only the components are parsed.
$parser->onlyParseComponents()->parse($template);
// To construct a Document instance and resolve tag pairs, we may use `syncFromParser`
$document = new Document;
$document->syncFromParser($parser)->resolveStructures();