RouteServiceProvider.php 861 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php namespace App\Providers;
  2. use App, URL;
  3. use Illuminate\Routing\RouteServiceProvider as ServiceProvider;
  4. class RouteServiceProvider extends ServiceProvider {
  5. /**
  6. * Called before routes are registered.
  7. *
  8. * Register any model bindings or pattern based filters.
  9. *
  10. * @return void
  11. */
  12. public function before()
  13. {
  14. URL::setRootControllerNamespace(
  15. trim(config('namespaces.controller'), '\\')
  16. );
  17. }
  18. /**
  19. * Define the routes for the application.
  20. *
  21. * @return void
  22. */
  23. public function map()
  24. {
  25. App::booted(function()
  26. {
  27. // Once the application has booted, we will include the default routes
  28. // file. This "namespace" helper will load the routes file within a
  29. // route group which automatically sets the controller namespace.
  30. $this->namespaced(function()
  31. {
  32. require app_path().'/Http/routes.php';
  33. });
  34. });
  35. }
  36. }