Add application stack to app server provider.
This commit is contained in:
parent
ab53517076
commit
2893433b35
|
@ -1,6 +1,8 @@
|
||||||
<?php namespace App\Providers;
|
<?php namespace App\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Routing\Router;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Illuminate\Routing\Stack\Builder as Stack;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider {
|
class AppServiceProvider extends ServiceProvider {
|
||||||
|
|
||||||
|
@ -11,7 +13,22 @@ class AppServiceProvider extends ServiceProvider {
|
||||||
*/
|
*/
|
||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
//
|
// This service provider is a convenient place to register your services
|
||||||
|
// in the IoC container. If you wish, you may make additional methods
|
||||||
|
// or service providers to keep the code more focused and granular.
|
||||||
|
|
||||||
|
$this->app->stack(function(Stack $stack, Router $router)
|
||||||
|
{
|
||||||
|
return $stack
|
||||||
|
->middleware('Illuminate\Cookie\Guard')
|
||||||
|
->middleware('Illuminate\Cookie\Queue')
|
||||||
|
->middleware('Illuminate\Session\Middlewares\Reader')
|
||||||
|
->middleware('Illuminate\Session\Middlewares\Writer')
|
||||||
|
->then(function($request) use ($router)
|
||||||
|
{
|
||||||
|
return $router->dispatch($request);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,10 +38,6 @@ public function boot()
|
||||||
*/
|
*/
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
// This service provider is a convenient place to register your services
|
|
||||||
// in the IoC container. If you wish, you may make additional methods
|
|
||||||
// or service providers to keep the code more focused and granular.
|
|
||||||
|
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue