Skip to content

Commit

Permalink
Merge pull request #2 from ichynul/patch-1
Browse files Browse the repository at this point in the history
未复用控制器的情况不执行此中间件
  • Loading branch information
walkor committed Sep 6, 2022
2 parents f5c0928 + 2717eec commit d5339d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ActionHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class ActionHook implements MiddlewareInterface
{
public function process(Request $request, callable $next) : Response
{
if(!config('app.controller_reuse', true)){
return $next($request);
}
if ($request->controller) {
// 禁止直接访问beforeAction afterAction
if ($request->action === 'beforeAction' || $request->action === 'afterAction') {
Expand Down

0 comments on commit d5339d6

Please sign in to comment.