RouteServiceProvider.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Providers;
  3. use Illuminate\Routing\Router;
  4. use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
  5. class RouteServiceProvider extends ServiceProvider
  6. {
  7. /**
  8. * This namespace is applied to your controller routes.
  9. *
  10. * In addition, it is set as the URL generator's root namespace.
  11. *
  12. * @var string
  13. */
  14. protected $namespace = 'App\Http\Controllers';
  15. /**
  16. * Define your route model bindings, pattern filters, etc.
  17. *
  18. * @param \Illuminate\Routing\Router $router
  19. * @return void
  20. */
  21. public function boot(Router $router)
  22. {
  23. //
  24. parent::boot($router);
  25. }
  26. /**
  27. * Define the routes for the application.
  28. *
  29. * @param \Illuminate\Routing\Router $router
  30. * @return void
  31. */
  32. public function map(Router $router)
  33. {
  34. $this->mapWebRoutes($router);
  35. //
  36. }
  37. /**
  38. * Define the "web" routes for the application.
  39. *
  40. * These routes all receive session state, CSRF protection, etc.
  41. *
  42. * @param \Illuminate\Routing\Router $router
  43. * @return void
  44. */
  45. protected function mapWebRoutes(Router $router)
  46. {
  47. $router->group([
  48. 'namespace' => $this->namespace, 'middleware' => 'web',
  49. ], function ($router) {
  50. require app_path('Http/routes.php');
  51. });
  52. }
  53. }