File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -933,11 +933,17 @@ private static function invoke($handler, $params = [])
933933
934934 // First check if is a static method, directly trying to invoke it.
935935 // If isn't a valid static method, we will try as a normal method invocation.
936- if (call_user_func_array ([new $ controller (), $ method ], $ params ) === false ) {
937- // Try to call the method as a non-static method. (the if does nothing, only avoids the notice)
938- if (forward_static_call_array ([$ controller , $ method ], $ params ) === false )
939- ;
936+ $ instance = new $ controller ();
937+
938+ if (method_exists ($ instance , '__middleware ' )) {
939+ $ middlewareResponse = $ instance ->__middleware ($ method , $ params );
940+
941+ if ($ middlewareResponse === false ) {
942+ return ;
943+ }
940944 }
945+
946+ call_user_func_array ([$ instance , $ method ], $ params );
941947 } elseif (strpos ($ handler , ': ' ) !== false ) {
942948 $ middlewareParams = [];
943949
You can’t perform that action at this time.
0 commit comments