This package allows you to use Laravel's simple yet powerful Blade templating engine as a standalone component.
composer require chr15k/laravel-blade
use Chr15k\Blade\Blade;
$views = 'views'; // Directory containing your blade files
$cache = 'cache'; // Directory for cached views
$blade = new Blade($views, $cache);
// views/test.blade.php
echo $blade
->view()
->make('test', ['foo' => 'bar']);
You can use all the features of blade as per the documentation: https://laravel.com/docs/7.x/blade
You can run the tests with:
vendor/bin/phpunit tests
The MIT License (MIT). Please see License File for more information.