-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
// Not in group
if (!$this->currentGroupPrefix) {
return;
}
middleware,use 在路由中都不生效
只有在group里的单个路由才生效
// Prepend group middleware at before.
if ($this->currentGroupChains) {
$route->setChains(array_merge($this->currentGroupChains, $route->getChains()));
}
数组合并是不是用问题,不知道设计是几维数组,middleware 都是一维数组嘛??
Route::use(['api'])->group('/api', function () {
Route::get('/test', \app\controller\IndexController::class . '@index')->middleware(['api1']);
},['api2','api3']);
dump 的middleware $router->getChains()
array(3) {
[0]=>
string(4) "api2"
[1]=>
string(4) "api3"
[2]=>
array(1) {
[0]=>
string(4) "api1"
}
}
Metadata
Metadata
Assignees
Labels
No labels