It's intended to compile a view from the HTML string 'on the fly'. You don't need to create a view file.
maidenvoyagesoftware/laravel-raw-view is a Laravel package for it's intended to compile a view from the html string 'on the fly'. you don't need to create a view file..
It currently has 1 GitHub stars and 13 downloads on Packagist (latest version 2.0.0).
Install it with composer require maidenvoyagesoftware/laravel-raw-view.
Discover more Laravel packages by maidenvoyagesoftware
or browse all Laravel packages to compare alternatives.
Last updated
RawView for Laravel 5.5+ gives an ability to compile a view from the raw HTML code with Blade directives without creating a view file.
Via Composer
$ composer require maidenvoyagesoftware/laravel-raw-view
After that the view_raw function will be available. It works like the view function but you must specify the HTML code instead of the name of the view.
class Item
{
public $tpl = '<li class="{{ $item->makeClasses() }}"> {{ $item->name }}';
...
public function render()
{
return view_raw($this->tpl, ['item' => $this])->render();
}
}
// View
<ul>
@foreach($items as $item)
{!! $item->render() !!}
@endforeach
</ul>
Please see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.