Commit e02e3456 authored by Taylor Otwell's avatar Taylor Otwell

Update middleware reference.

parent a98c0d64
<?php namespace App\Http\Middleware;
use Closure;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Routing\Middleware;
class AuthenticatedWithBasicAuth implements Middleware {
/**
* The Guard implementation.
*
* @var Guard
*/
protected $auth;
/**
* Create a new filter instance.
*
* @param Guard $auth
* @return void
*/
public function __construct(Guard $auth)
{
$this->auth = $auth;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
return $this->auth->basic() ?: $next($request);
}
}
...@@ -12,7 +12,7 @@ class RouteServiceProvider extends ServiceProvider { ...@@ -12,7 +12,7 @@ class RouteServiceProvider extends ServiceProvider {
*/ */
protected $middleware = [ protected $middleware = [
'auth' => 'App\Http\Middleware\Authenticated', 'auth' => 'App\Http\Middleware\Authenticated',
'auth.basic' => 'App\Http\Middleware\AuthenticatedWithBasicAuth', 'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticatedWithBasicAuth',
'guest' => 'App\Http\Middleware\IsGuest', 'guest' => 'App\Http\Middleware\IsGuest',
]; ];
......
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