Here is the code of my controller:
public function getIndex()
{
// Get all the apps
$apps = $this->app->orderBy('created_at', 'DESC')->paginate(50);
// Show the page
return View::make('site/apps/index', compact('apps'));
}
From this how can I get in my template "site/apps/index" the name of the page?
When I do a var_dump() I get a huge array and object that is just impossible to sift through.
I am looking for a best practice.
The reason I am trying to get the name of the page is to control when a CSS value is added to the HTML.
Here is what I am doing right now:
@if (Auth::check())
<style>
body {
background-color: #fbfbfb !important;
}
</style>
@endif
But not all the pages when I login should have that background color, just one... The page name is apps.
If you have a better way of doing this you are welcome to share it.