Created
February 16, 2016 02:05
-
-
Save milon/d3ff4faf93f521439c9f to your computer and use it in GitHub Desktop.
Laravel Route Example
This file contains hidden or 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\Routing\Router; | |
| use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; | |
| class RouteServiceProvider extends ServiceProvider | |
| { | |
| protected $webNamespace = 'App\Http\Controllers\Web'; | |
| protected $apiNamespace = 'App\Http\Controllers\Api'; | |
| public function boot(Router $router) | |
| { | |
| parent::boot($router); | |
| } | |
| public function map(Router $router) | |
| { | |
| $router->group(['namespace' => $this->webNamespace], function ($router) { | |
| require app_path('Http/web_routes.php'); | |
| }); | |
| $router->group(['namespace' => $this->apiNamespace], function ($router) { | |
| require app_path('Http/api_routes.php'); | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment