I am building my Laravel app through the use of RESTful controllers.
Currently, an 'agent' can login, to view all of their 'notifications'.
The structure is:
/agents
When they chose a notification to view, instead of:
/agents/$id
I want it to be:
/agents/notifications/$id
Solely because it follows logically. If it was '/agents/$id' I would expect to see the agent's profile, for example.
Is there a way of including a subdirectory into the 'show' function? Or do I need to create a notification controller that somehow sites within the agent directory.
My route is:
Route::controller('agents', 'AgentsController');
With the show function:
public function show($id)
{
$alerts = Alert::where('id', $id)->first();
$this->layout->content = View::make('agents.notification.show', array('alerts' => $alerts));
}
Any help would be hugely appreciated.