Skip to content

Commit

Permalink
allow user to define route
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissm79 committed Jun 30, 2016
1 parent a44fdc7 commit ebe056a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
'cache' => storage_path('lighthouse/cache'),
'controller' => 'Nuwave\Lighthouse\Support\Http\Controllers\LaravelController@query',
'pagination_macro' => 'paginate',
'route' => [],
// 'model_path' => 'App\\Models',
// 'camel_case' => false,

Expand Down
5 changes: 4 additions & 1 deletion src/Support/Http/routes.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

$route = config('lighthouse.route') ?: [];
$controller = config('lighthouse.controller');

Route::post('graphql', ['as' => 'graphql', 'uses' => $controller]);
Route::group($route, function () use ($controller) {
Route::post('graphql', ['as' => 'graphql', 'uses' => $controller]);
});

0 comments on commit ebe056a

Please sign in to comment.