3 namespace BookStack\Providers;
5 use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
6 use Illuminate\Support\Facades\Route;
8 class RouteServiceProvider extends ServiceProvider
11 * This namespace is applied to the controller routes in your routes file.
13 * In addition, it is set as the URL generator's root namespace.
17 protected $namespace = 'BookStack\Http\Controllers';
20 * Define your route model bindings, pattern filters, etc.
24 public function boot()
30 * Define the routes for the application.
36 $this->mapWebRoutes();
37 $this->mapApiRoutes();
41 * Define the "web" routes for the application.
43 * These routes all receive session state, CSRF protection, etc.
47 protected function mapWebRoutes()
50 'middleware' => 'web',
51 'namespace' => $this->namespace,
52 ], function ($router) {
53 require base_path('routes/web.php');
58 * Define the "api" routes for the application.
60 * These routes are typically stateless.
64 protected function mapApiRoutes()
67 'middleware' => 'api',
68 'namespace' => $this->namespace . '\Api',
70 ], function ($router) {
71 require base_path('routes/api.php');