-
Notifications
You must be signed in to change notification settings - Fork 8
/
routes.php
31 lines (22 loc) · 809 Bytes
/
routes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/** @var \Illuminate\Contracts\Routing\Registrar $router */
$router = app('router');
$router->group(config('uit.lighthouse::route', []), function () use ($router): void {
$routeName = config('uit.lighthouse::route_name', 'graphql');
$controller = config('uit.lighthouse::controller');
$methods = config('uit.lighthouse::route_enable_get', false)
? ['GET', 'POST']
: ['POST'];
$router->match($methods, $routeName, [
'as' => 'lighthouse.graphql',
'uses' => $controller,
]);
});
// Route::get('graphql/schema.graphql', function(){
// $schemesBody = '';
// $schemes = \Uit\Lighthouse\Models\Schema::published()->get();
// foreach ($schemes as $schema) {
// $schemesBody .= $schema->schema;
// }
// return $schemesBody;
// });