<i id='NEzlL'><tr id='NEzlL'><dt id='NEzlL'><q id='NEzlL'><span id='NEzlL'><b id='NEzlL'><form id='NEzlL'><ins id='NEzlL'></ins><ul id='NEzlL'></ul><sub id='NEzlL'></sub></form><legend id='NEzlL'></legend><bdo id='NEzlL'><pre id='NEzlL'><center id='NEzlL'></center></pre></bdo></b><th id='NEzlL'></th></span></q></dt></tr></i><div id='NEzlL'><tfoot id='NEzlL'></tfoot><dl id='NEzlL'><fieldset id='NEzlL'></fieldset></dl></div>

<small id='NEzlL'></small><noframes id='NEzlL'>

  • <legend id='NEzlL'><style id='NEzlL'><dir id='NEzlL'><q id='NEzlL'></q></dir></style></legend>
      <tfoot id='NEzlL'></tfoot>

        • <bdo id='NEzlL'></bdo><ul id='NEzlL'></ul>

      1. 禁用 Laravel 的内置错误屏幕

        时间:2023-09-21
        <tfoot id='bGe83'></tfoot>
          <bdo id='bGe83'></bdo><ul id='bGe83'></ul>
            <tbody id='bGe83'></tbody>

              <small id='bGe83'></small><noframes id='bGe83'>

                  <legend id='bGe83'><style id='bGe83'><dir id='bGe83'><q id='bGe83'></q></dir></style></legend>
                  <i id='bGe83'><tr id='bGe83'><dt id='bGe83'><q id='bGe83'><span id='bGe83'><b id='bGe83'><form id='bGe83'><ins id='bGe83'></ins><ul id='bGe83'></ul><sub id='bGe83'></sub></form><legend id='bGe83'></legend><bdo id='bGe83'><pre id='bGe83'><center id='bGe83'></center></pre></bdo></b><th id='bGe83'></th></span></q></dt></tr></i><div id='bGe83'><tfoot id='bGe83'></tfoot><dl id='bGe83'><fieldset id='bGe83'></fieldset></dl></div>

                • 本文介绍了禁用 Laravel 的内置错误屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我想禁用 Laravel 的错误屏幕,该屏幕显示带有调试信息和函数跟踪的错误/异常.主要是因为我使用 Laravel 作为移动 API 后端,而这些响应在移动设备上更难阅读.

                  I want to disable Laravel's error screen that shows the errors/exceptions with debugging information and functions trace. Mostly because I'm using Laravel as mobile API backend and those responses are harder to read on a mobile device.

                  请注意,我想要错误,而不是花哨的错误页面.

                  Please notice that I want the errors, but not the fancy error page.

                  有什么建议吗?

                  推荐答案

                  进入Laravel项目->app文件夹->config文件夹->app.php设置

                  Go to Laravel project -> app folder-> config folder -> app.php set

                  'debug' => false,
                  

                  这将显示一个简单的错误页面,如 Ops!出了点问题.

                  This will show a simple error page like Ops! Something went wrong.

                  Laravel App Facade 提供了一种使用 Laravel 文档中提到的错误方法来捕获异常的方法

                  Laravel App facade provides a way to way catch the exceptions using error method as mentioned in the Laravel docs

                  App::error(function(Exception $exception)
                  {
                      // handle your exception
                  });
                  

                  你可以在filters.php中放置App::error方法

                  You can place App::error method in the filters.php

                  如果你想进一步往下看,Laravel 正在使用 Symfony 来显示这些页面.我还没有真正尝试过改变这件事,也许有人会想出更好的答案.

                  and Laravel is using Symfony to display those pages if you want to further go down. I have not really tried to change this thing, maybe someone will come up with a better answer.

                  这篇关于禁用 Laravel 的内置错误屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:PHP 自定义错误页面 下一篇:PHP 字符串中的 Unicode 字符

                  相关文章

                  最新文章

                  <i id='pfdSX'><tr id='pfdSX'><dt id='pfdSX'><q id='pfdSX'><span id='pfdSX'><b id='pfdSX'><form id='pfdSX'><ins id='pfdSX'></ins><ul id='pfdSX'></ul><sub id='pfdSX'></sub></form><legend id='pfdSX'></legend><bdo id='pfdSX'><pre id='pfdSX'><center id='pfdSX'></center></pre></bdo></b><th id='pfdSX'></th></span></q></dt></tr></i><div id='pfdSX'><tfoot id='pfdSX'></tfoot><dl id='pfdSX'><fieldset id='pfdSX'></fieldset></dl></div>

                    <small id='pfdSX'></small><noframes id='pfdSX'>

                      <tfoot id='pfdSX'></tfoot>

                      <legend id='pfdSX'><style id='pfdSX'><dir id='pfdSX'><q id='pfdSX'></q></dir></style></legend>
                      • <bdo id='pfdSX'></bdo><ul id='pfdSX'></ul>