我想知道的是,是否能够关闭laravel 4.1中的错误消息。
我有一个项目,其中包含3个环境:生产,测试版和开发。是否可以关闭生产中的错误消息?
最佳答案
为了不让您的用户看到错误消息,您必须:
1)打开app/config/app.php
并设置
'debug' => false
2)打开
app/start/global.php
并编辑:App::error(function(Exception $exception, $code)
{
Log::error($exception);
return "whatever you need here!"; // <---- add a return command
});
3)此返回行可能类似于:
return Redirect::route('userErrorMessageRouteName');
要么
return View::make('userErrorMessageView');
关于php - 在生产站点中删除laravel 4.1错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21391656/