Created
October 25, 2016 03:58
-
-
Save febridev/08f861cd38e23b4ed81b329199b73ebf to your computer and use it in GitHub Desktop.
set custom not found page (success in laravel 5.3)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
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