Last active
May 2, 2017 15:22
-
-
Save EddyF/df495081495b1d677cfed17f76208fc2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; | |
use Illuminate\Routing\Router; | |
class RouteServiceProvider extends ServiceProvider | |
{ | |
/** | |
* This namespace is applied to the controller routes in your routes file. | |
* | |
* In addition, it is set as the URL generator's root namespace. | |
* | |
* @var string | |
*/ | |
protected $apiV1Namespace = 'App\Http\Controllers\v1'; | |
protected $apiV2Namespace = 'App\Http\Controllers\v2'; | |
/** | |
* Define your route model bindings, pattern filters, etc. | |
* | |
* @param \Illuminate\Routing\Router $router | |
* | |
* @return void | |
*/ | |
public function boot(Router $router) | |
{ | |
// | |
parent::boot($router); | |
} | |
/** | |
* Define the routes for the application. | |
* | |
* @param \Illuminate\Routing\Router $router | |
* | |
* @return void | |
*/ | |
public function map(Router $router) | |
{ | |
/* | |
|-------------------------------------------------------------------------- | |
| v1 API Router | |
|-------------------------------------------------------------------------- | |
*/ | |
$router->group(['namespace' => $this->apiV1Namespace], function ($router) { | |
require app_path('Http/routes.v1.php'); | |
}); | |
/* | |
|-------------------------------------------------------------------------- | |
| v2 Api Router | |
|-------------------------------------------------------------------------- | |
*/ | |
$router->group(['namespace' => $this->apiV2Namespace], function ($router) { | |
require app_path('Http/routes.v2.php'); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment