I have the following code in my controller:
public function edit($id)
{
try
{
$post = Post::findOrFail($id);
$this->layout->content = View::make('edit.press');
}
catch(ModelNotFoundException $e)
{
return Redirect::to('press');
}
}
when I actually go to the page /press/1/edit & id 1 is not in there I get an exception error : ModelNotFoundExceptio , Laravel error pages shows up and its not redirecting to the press page again? why please help me