]> BookStack Code Mirror - bookstack/blob - app/Providers/RouteServiceProvider.php
Finished migration of last angular code
[bookstack] / app / Providers / RouteServiceProvider.php
1 <?php
2
3 namespace BookStack\Providers;
4
5 use Illuminate\Routing\Router;
6 use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
7 use Route;
8
9 class RouteServiceProvider extends ServiceProvider
10 {
11     /**
12      * This namespace is applied to the controller routes in your routes file.
13      *
14      * In addition, it is set as the URL generator's root namespace.
15      *
16      * @var string
17      */
18     protected $namespace = 'BookStack\Http\Controllers';
19
20     /**
21      * Define your route model bindings, pattern filters, etc.
22      *
23      * @return void
24      */
25     public function boot()
26     {
27         parent::boot();
28     }
29
30     /**
31      * Define the routes for the application.
32      *
33      * @return void
34      */
35     public function map()
36     {
37         $this->mapWebRoutes();
38 //        $this->mapApiRoutes();
39     }
40     /**
41      * Define the "web" routes for the application.
42      *
43      * These routes all receive session state, CSRF protection, etc.
44      *
45      * @return void
46      */
47     protected function mapWebRoutes()
48     {
49         Route::group([
50             'middleware' => 'web',
51             'namespace' => $this->namespace,
52         ], function ($router) {
53             require base_path('routes/web.php');
54         });
55     }
56     /**
57      * Define the "api" routes for the application.
58      *
59      * These routes are typically stateless.
60      *
61      * @return void
62      */
63     protected function mapApiRoutes()
64     {
65         Route::group([
66             'middleware' => 'api',
67             'namespace' => $this->namespace,
68             'prefix' => 'api',
69         ], function ($router) {
70             require base_path('routes/api.php');
71         });
72     }
73 }