Php 基于用户的Dingo Api节流

Php 基于用户的Dingo Api节流,php,laravel-5,dingo-api,Php,Laravel 5,Dingo Api,我想限制特定于Laravel应用程序中用户的API请求。 我尝试使用下面的代码来创建中提到的自定义油门 我尝试添加以下代码: 'throttling' => [ 'custom' => new CustomThrottle(['limit' => 200, 'expires' => 10]) ] 在Kernel.php的中间件中。但是IDE抛出错误,声明不允许使用表达式 如何使用Dingo在Laravel中基于用户创建API节流阀 'throttling' =&

我想限制特定于Laravel应用程序中用户的API请求。 我尝试使用下面的代码来创建中提到的自定义油门

我尝试添加以下代码:

'throttling' => [
    'custom' => new CustomThrottle(['limit' => 200, 'expires' => 10])
]
在Kernel.php的中间件中。但是IDE抛出错误,声明不允许使用
表达式

如何使用Dingo在Laravel中基于用户创建API节流阀

'throttling' => [
    'custom' => new CustomThrottle(['limit' => 200, 'expires' => 10])
]