Answers for "redirect 404 in laravel"

PHP
0

redirect 404 in laravel

return abort(404, 'Page not found.');
return abort(403, 'Unauthorized action.');
"create a resources/views/errors/404.blade.php"
Posted by: Guest on November-16-2020
0

none

/**
 * Render an exception into an HTTP response.
 *
 * @param  \Illuminate\Http\Request  $request
 * @param  \Exception  $exception
 * @return \Illuminate\Http\Response
 */
public function render($request, Exception $exception)
{
    if ($this->isHttpException($exception)) {
        if ($exception->getStatusCode() == 404) {
            return response()->view('errors.' . '404', 
Posted by: Guest on January-01-1970

Browse Popular Code Answers by Language