RouteServiceProvider.php 860 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. }