How to render view from string with blade template format?
like this:
$str = "{{ $abc }}";
return View::renderFromString($str)->with('abc', $xyz);
If I understand correctly this may help you,
https://github.com/TerrePorter/StringBladeCompiler
This is a fork of the next link below. Requires a few keys: updated_at, cache_key, and template, but it removes the database model requirement.
https://github.com/Flynsarmy/laravel-db-blade-compiler
With this you can use the Eloquent model to bring the template to view.
Take a look at Iluminate\View\Compilers\BladeCompiler::compileString
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community