RouteServiceProvider.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. * @param \Illuminate\Routing\Router $router
  41. * @return void
  42. */
  43. protected function mapWebRoutes(Router $router)
  44. {
  45. $router->group([
  46. 'namespace' => $this->namespace, 'middleware' => 'web'
  47. ], function ($router) {
  48. require app_path('Http/routes.php');
  49. });
  50. }
  51. }