【问题标题】:How to off throttle in debug=true?如何在 debug=true 中关闭油门?
【发布时间】:2017-11-13 11:17:25
【问题描述】:

在 Laravel 的 App/Http/Kernel 中存在这样的字符串:

protected $middlewareGroups = [
    'api' => [
        'throttle:60,1',
        'bindings',
    ],
];

当 ENV 中的调试模式设置为 true 时如何关闭油门?

【问题讨论】:

    标签: php laravel environment-variables


    【解决方案1】:

    恐怕你现在不能在 Laravel 中动态设置它。'

    但是您可以做的是定义自己的限制中间件,然后您可以动态分配限制值。

    注意:您可以像这样获取调试配置:

    config('app.debug')
    

    【讨论】:

      猜你喜欢
      • 2021-12-13
      • 2012-12-22
      • 2018-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-26
      • 1970-01-01
      相关资源
      最近更新 更多