Commit 2893433b authored by Taylor Otwell's avatar Taylor Otwell

Add application stack to app server provider.

parent ab535170
<?php namespace App\Providers;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Stack\Builder as Stack;
class AppServiceProvider extends ServiceProvider {
......@@ -11,7 +13,22 @@ class AppServiceProvider extends ServiceProvider {
*/
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 @@ class AppServiceProvider extends ServiceProvider {
*/
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.
//
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment