Skip to content

Commit 732ddfe

Browse files
rwinzhangMikk Mihkel Nurges
authored andcommitted
Support additional route group attributes (#123)
1 parent 63a4724 commit 732ddfe

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/Rebing/GraphQL/routes.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
Route::group([
3+
Route::group(array_merge([
44
'prefix' => config('graphql.prefix'),
5-
'middleware' => config('graphql.middleware', [])
6-
], function($router)
5+
'middleware' => config('graphql.middleware', []),
6+
], config('graphql.route_group_attributes', [])), function($router)
77
{
88
// Routes
99
$routes = config('graphql.routes');

src/config/config.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@
4646
// Any middleware for the graphql route group
4747
'middleware' => [],
4848

49+
// Additional route group attributes
50+
//
51+
// Example:
52+
//
53+
// 'route_group_attributes' => ['guard' => 'api']
54+
//
55+
'route_group_attributes' => [],
56+
4957
// The name of the default schema used when no argument is provided
5058
// to GraphQL::schema() or when the route is used without the graphql_schema
5159
// parameter.

0 commit comments

Comments
 (0)