Skip to content

Commit

Permalink
Move back to chained middleware call
Browse files Browse the repository at this point in the history
  • Loading branch information
jonerickson committed Feb 22, 2025
1 parent d029b86 commit d0e9ccd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Laravel/routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,10 @@
/* @var HttpOperation $operation */
$route = Route::addRoute($operation->getMethod(), $uriTemplate, ['uses' => ApiPlatformController::class, 'prefix' => $operation->getRoutePrefix() ?? '']);
$route->middleware(ApiPlatformMiddleware::class.':'.$operation->getName())
->middleware($operation->getMiddleware())
->where('_format', '^\.[a-zA-Z]+')
->name($operation->getName())
->setDefaults(['_api_operation_name' => $operation->getName(), '_api_resource_class' => $operation->getClass()]);

if ($middleware = $operation->getMiddleware()) {
$route->middleware($middleware);
}
}
}
}
Expand Down

0 comments on commit d0e9ccd

Please sign in to comment.