@@ -113,15 +113,15 @@ function () use ($controller, $only, $except, $patterns) {
113
113
// Get endpoints and parameter patterns for Route
114
114
[$ endpoints , $ routePatterns ] = $ this ->getRouteValues ($ method , $ patterns );
115
115
116
- $ endpoints = implode ('/ ' , $ endpoints );
116
+ $ endpoint = implode ('/ ' , $ endpoints );
117
117
118
118
$ handler = [$ classRef ->getName (), $ method ->name ];
119
- $ routePath = ($ path !== $ this ->mainMethod ? $ path : '' ) . "/ {$ endpoints }" ;
119
+ $ routePath = ($ path !== $ this ->mainMethod ? $ path : '' ) . "/ {$ endpoint }" ;
120
120
121
121
// for volt
122
122
if (str_starts_with ($ method ->name , 'volt ' )) {
123
123
if (class_exists (Volt::class) && $ method ->getReturnType ()?->getName() === 'string ' ) {
124
- Volt::route ($ routePath , $ method ->invoke (new ($ classRef ->getName ())))
124
+ Volt::route ($ routePath , $ method ->invoke (new ($ classRef ->getName ()), ... $ endpoints ))
125
125
->where ($ routePatterns )->name ("{$ method ->name }" )->middleware ($ middleware );
126
126
}
127
127
@@ -134,7 +134,7 @@ function () use ($controller, $only, $except, $patterns) {
134
134
continue ;
135
135
}
136
136
137
- $ handler = $ method ->invoke (new ($ classRef ->getName ()));
137
+ $ handler = $ method ->invoke (new ($ classRef ->getName ()), ... $ endpoints );
138
138
if (!is_subclass_of ($ handler , Component::class)) {
139
139
continue ;
140
140
}
0 commit comments