Commit b8f3dd62 authored by Taylor Otwell's avatar Taylor Otwell

Working on middle wares.

parent 43e8c60a
...@@ -39,9 +39,9 @@ class AuthMiddleware implements Middleware { ...@@ -39,9 +39,9 @@ class AuthMiddleware implements Middleware {
/** /**
* Handle an incoming request. * Handle an incoming request.
* *
* @param \Symfony\Component\HttpFoundation\Request $request * @param \Illuminate\Http\Request $request
* @param \Closure $next * @param \Closure $next
* @return \Symfony\Component\HttpFoundation\Response * @return mixed
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
......
...@@ -27,9 +27,9 @@ class BasicAuthMiddleware implements Middleware { ...@@ -27,9 +27,9 @@ class BasicAuthMiddleware implements Middleware {
/** /**
* Handle an incoming request. * Handle an incoming request.
* *
* @param \Symfony\Component\HttpFoundation\Request $request * @param \Illuminate\Http\Request $request
* @param \Closure $next * @param \Closure $next
* @return \Symfony\Component\HttpFoundation\Response * @return mixed
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
......
...@@ -9,13 +9,13 @@ class CsrfMiddleware implements Middleware { ...@@ -9,13 +9,13 @@ class CsrfMiddleware implements Middleware {
/** /**
* Handle an incoming request. * Handle an incoming request.
* *
* @param \Symfony\Component\HttpFoundation\Request $request * @param \Illuminate\Http\Request $request
* @param \Closure $next * @param \Closure $next
* @return \Symfony\Component\HttpFoundation\Response * @return mixed
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
if ($request->getSession()->token() != $request->input('_token')) if ($request->session()->token() != $request->input('_token'))
{ {
throw new TokenMismatchException; throw new TokenMismatchException;
} }
......
...@@ -28,9 +28,9 @@ class GuestMiddleware implements Middleware { ...@@ -28,9 +28,9 @@ class GuestMiddleware implements Middleware {
/** /**
* Handle an incoming request. * Handle an incoming request.
* *
* @param \Symfony\Component\HttpFoundation\Request $request * @param \Illuminate\Http\Request $request
* @param \Closure $next * @param \Closure $next
* @return \Symfony\Component\HttpFoundation\Response * @return mixed
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
......
...@@ -28,9 +28,9 @@ class MaintenanceMiddleware { ...@@ -28,9 +28,9 @@ class MaintenanceMiddleware {
/** /**
* Handle an incoming request. * Handle an incoming request.
* *
* @param \Symfony\Component\HttpFoundation\Request $request * @param \Illuminate\Http\Request $request
* @param \Closure $next * @param \Closure $next
* @return \Symfony\Component\HttpFoundation\Response * @return mixed
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
......
...@@ -31,4 +31,21 @@ class AppServiceProvider extends ServiceProvider { ...@@ -31,4 +31,21 @@ class AppServiceProvider extends ServiceProvider {
'Illuminate\Session\Middleware\Writer', '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);
});
});
}
} }
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