PHP code example of stillat / blade-parser

1. Go to this page and download the library: Download stillat/blade-parser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

stillat / blade-parser example snippets



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



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



// Find all "alert" components.
$document->findComponentsByTagName('alert')
         ->each(fn($node) => ...);
bash
php artisan vendor:publish --tag=blade
bash
php artisan blade:validate