|
16 | 16 | use Illuminate\Http\Request;
|
17 | 17 | use Illuminate\Http\Response;
|
18 | 18 | use Illuminate\Routing\Events\RouteMatched;
|
| 19 | +use Illuminate\Support\Arr; |
19 | 20 | use Illuminate\Support\Collection;
|
20 | 21 | use Illuminate\Support\Str;
|
21 | 22 | use Illuminate\Support\Stringable;
|
@@ -369,19 +370,21 @@ public function apiResource($name, $controller, array $options = [])
|
369 | 370 | * Create a route group with shared attributes.
|
370 | 371 | *
|
371 | 372 | * @param array $attributes
|
372 |
| - * @param \Closure|string $routes |
| 373 | + * @param \Closure|array|string $routes |
373 | 374 | * @return void
|
374 | 375 | */
|
375 | 376 | public function group(array $attributes, $routes)
|
376 |
| - { |
377 |
| - $this->updateGroupStack($attributes); |
| 377 | + { |
| 378 | + foreach (Arr::wrap($routes) as $groupRoutes) { |
| 379 | + $this->updateGroupStack($attributes); |
378 | 380 |
|
379 |
| - // Once we have updated the group stack, we'll load the provided routes and |
380 |
| - // merge in the group's attributes when the routes are created. After we |
381 |
| - // have created the routes, we will pop the attributes off the stack. |
382 |
| - $this->loadRoutes($routes); |
| 381 | + // Once we have updated the group stack, we'll load the provided routes and |
| 382 | + // merge in the group's attributes when the routes are created. After we |
| 383 | + // have created the routes, we will pop the attributes off the stack. |
| 384 | + $this->loadRoutes($groupRoutes); |
383 | 385 |
|
384 |
| - array_pop($this->groupStack); |
| 386 | + array_pop($this->groupStack); |
| 387 | + } |
385 | 388 | }
|
386 | 389 |
|
387 | 390 | /**
|
|
0 commit comments