Laravel 记录一次报错:TypeError Illegal offset type in isset or empty 作者: Chuwen 时间: 2021-08-21 分类: PHP ## TypeError: Illegal offset type in isset or empty > Illuminate\Routing\Router::uniqueMiddleware > vendor/laravel/framework/src/Illuminate/Routing/Router.php:1290  错误原因,大概可以定位到你的路由配置有问题,我的出现这个报错是我定义了这样的路由: ```php // 添加/更新 信用卡信息 Route::middleware([['throttle:set-card-info']]) ->any('set-card-info', 'App\Http\Controllers\V1\XxxxxxxxxxxController@setInfo'); ``` 错误原因就是中间件配置那里出现了问题,多打了一对 `[]` 应该改为 `Route::middleware(['throttle:set-card-info'])` ... 标签: Laravel