For the views maybe you can use nested views.
For the controller i don't see any other solution than doing two different request.
I just filter that kind of thing at the repository level. For example, I might have a ComputerRepository class with a getAll function but also a FilterByRoleId function. At the controller level, I'll do something like this:
function index()
{
$computers = $this->repo->filterByRoleId(Auth::user()->role)->getAll();
return View::make('computers.list', compact('computers'));
}
thepsion5 said:
I just filter that kind of thing at the repository level. For example, I might have a ComputerRepository class with a getAll function but also a FilterByRoleId function. At the controller level, I'll do something like this:
function index() { $computers = $this->repo->filterByRoleId(Auth::user()->role)->getAll(); return View::make('computers.list', compact('computers')); }
And if it were also multi-tenant?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community