File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -865,7 +865,7 @@ private static function invoke($handler, $params = [])
865865 $ handler ,
866866 $ params
867867 );
868- } elseif (stripos ($ handler , '@ ' ) !== false ) {
868+ } else if (stripos ($ handler , '@ ' ) !== false ) {
869869 list ($ controller , $ method ) = explode ('@ ' , $ handler );
870870
871871 if (!class_exists ($ controller )) {
@@ -881,8 +881,15 @@ private static function invoke($handler, $params = [])
881881 if (call_user_func_array ([new $ controller (), $ method ], $ params ) === false ) {
882882 // Try to call the method as a non-static method. (the if does nothing, only avoids the notice)
883883 if (forward_static_call_array ([$ controller , $ method ], $ params ) === false )
884- ;
884+ ;
885885 }
886+ } else if (strpos ($ handler , ': ' ) !== false ) {
887+ $ middlewareParams = [];
888+
889+ $ middlewareParams = explode (': ' , $ handler );
890+ $ middleware = array_shift ($ middlewareParams );
891+
892+ static ::$ namedMiddleware [$ middleware ](explode ('| ' , $ middlewareParams [0 ] ?? '' ));
886893 }
887894 }
888895}
You can’t perform that action at this time.
0 commit comments