AppServiceProvider.php 1019 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php namespace App\Providers;
  2. use Illuminate\Routing\Router;
  3. use Illuminate\Support\ServiceProvider;
  4. use Illuminate\Routing\Stack\Builder as Stack;
  5. class AppServiceProvider extends ServiceProvider {
  6. /**
  7. * Bootstrap any necessary services.
  8. *
  9. * @return void
  10. */
  11. public function boot()
  12. {
  13. // This service provider is a convenient place to register your services
  14. // in the IoC container. If you wish, you may make additional methods
  15. // or service providers to keep the code more focused and granular.
  16. $this->app->stack(function(Stack $stack, Router $router)
  17. {
  18. return $stack
  19. ->middleware('Illuminate\Cookie\Guard')
  20. ->middleware('Illuminate\Cookie\Queue')
  21. ->middleware('Illuminate\Session\Middlewares\Reader')
  22. ->middleware('Illuminate\Session\Middlewares\Writer')
  23. ->then(function($request) use ($router)
  24. {
  25. return $router->dispatch($request);
  26. });
  27. });
  28. }
  29. /**
  30. * Register the service provider.
  31. *
  32. * @return void
  33. */
  34. public function register()
  35. {
  36. //
  37. }
  38. }