Use Laravel Blade templates as a standalone component without the full Laravel framework
Full documentation is available at http://duncan3dc.github.io/blade/
PHPDoc API documentation is also available at http://duncan3dc.github.io/blade/api/
Output the view from /var/www/views/index.blade.php
:
use duncan3dc\Laravel\BladeInstance;
$blade = new BladeInstance("/var/www/views", "/var/www/cache/views");
echo $blade->render("index");
There is also a static class available:
use duncan3dc\Laravel\Blade;
echo Blade::render("index");
Tested with PHP 8.1.26