Update middleware reference.
This commit is contained in:
parent
a98c0d64c7
commit
e02e3456ed
|
@ -1,39 +0,0 @@
|
|||
<?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 {
|
|||
*/
|
||||
protected $middleware = [
|
||||
'auth' => 'App\Http\Middleware\Authenticated',
|
||||
'auth.basic' => 'App\Http\Middleware\AuthenticatedWithBasicAuth',
|
||||
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticatedWithBasicAuth',
|
||||
'guest' => 'App\Http\Middleware\IsGuest',
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in New Issue