I'm writing a simple app which only relies on a few routes and views. I've setup an overall layout and successfully nested a template using the following.
routes.php
View::name('layouts.master', 'master');
$layout = View::of('master');
Route::get('/users', function() use ($layout)
{
$users = Users::all()
return $layout->nest('content','list-template');
});
master.blade.php
<h1>Template</h1>
<?=$content?>
list-template.php
foreach($users as $user) {
echo $user->title;
}
How do I pass the query results $users into my master template and then into list-temple.php?
Thanks