Skip to content

Commit

Permalink
added new config options
Browse files Browse the repository at this point in the history
added new route settings to enable override the API prefix endpoint and
the middleware
  • Loading branch information
Martin Kluska authored and Riari committed Feb 11, 2017
1 parent eac7a3b commit 5d0df9a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
20 changes: 20 additions & 0 deletions config/routing.php
Expand Up @@ -35,4 +35,24 @@

'as' => 'forum.',

/*
|--------------------------------------------------------------------------
| API Prefix
|--------------------------------------------------------------------------
|
| The prefix to use for all api calls.
|
*/
'api_prefix' => 'api',

/*
|--------------------------------------------------------------------------
| API middleware to use
|--------------------------------------------------------------------------
|
| All api calls will use this middleware
|
*/
'middleware' => 'forum.api.auth'

];
8 changes: 7 additions & 1 deletion routes.php
@@ -1,6 +1,12 @@
<?php

$r->group(['prefix' => 'api', 'namespace' => 'API', 'as' => 'api.', 'middleware' => 'forum.api.auth'], function ($r)
$r->group(
[
'prefix' => config('forum.routing.api_prefix', "api"),
'namespace' => 'API',
'as' => 'api.',
'middleware' => config('forum.routing.middleware', 'forum.api.auth')
], function ($r)
{
// Categories
$r->group(['prefix' => 'category', 'as' => 'category.'], function ($r)
Expand Down

0 comments on commit 5d0df9a

Please sign in to comment.