Working on middle wares.

This commit is contained in:
Taylor Otwell
2014-10-06 15:46:34 -05:00
parent 43e8c60a11
commit b8f3dd6265
6 changed files with 28 additions and 11 deletions

View File

@@ -31,4 +31,21 @@ class AppServiceProvider extends ServiceProvider {
'Illuminate\Session\Middleware\Writer',
];
/**
* Build the application stack based on the provider properties.
*
* @return void
*/
public function stack()
{
$this->app->stack(function(Stack $stack, Router $router)
{
return $stack
->middleware($this->stack)->then(function($request) use ($router)
{
return $router->dispatch($request);
});
});
}
}