【laravel5.4】自定义404、503等页面

1、处理自定义错误或不存在页面:生产环境一定要关闭debug模式。

 

public function render($request, Exception $exception)
{
    if ($exception) {
        return response()->view('error.'.$exception->getStatusCode(), [],$exception->getStatusCode());
    }
    return parent::render($request, $exception);
}

 

posted @ 2018-04-08 08:49  PHP急先锋  阅读(212)  评论(0编辑  收藏  举报