Skip to content

Instantly share code, notes, and snippets.

@febridev
Created October 25, 2016 03:58
Show Gist options
  • Save febridev/08f861cd38e23b4ed81b329199b73ebf to your computer and use it in GitHub Desktop.
Save febridev/08f861cd38e23b4ed81b329199b73ebf to your computer and use it in GitHub Desktop.
set custom not found page (success in laravel 5.3)
...
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* Render an exception into a response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
//Add this line for custom Not Found
if($e instanceof NotFoundHttpException)
{
return response()->view('missing', [], 404);
}
//end add line
return parent::render($request, $exception);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment