I would like to know if there is any way to save the return of a view in Laravel to a string
.
Generally, we return to view
in order to "print" the result of an action on the page:
function getIndex() {
return view('hello');
}
I tried to save a variable, but it is returning Illuminate\View\View(Object)
when I execute a var_dump
.
Example of what I have so far:
$view = view('hello');
var_dump($view); // retorna Object
Is there any way to assign string
of view
to a variable?