estoy intentando modificar el middleware de Authentication de Laravel, al añadir el metodo handle para que si el usuario ha sido descativado haga logout, recibo el siguiente error:
Declaration of App\Http\Middleware\Authenticate::handle($request, Closure $next, $guard) should be compatible with Illuminate\Auth\Middleware\Authenticate::handle($request, Closure $next, ...$guards)
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Closure;
use Auth;
class Authenticate extends Middleware {
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string
*/
protected function redirectTo($request) {
if (!$request->expectsJson()) {
return route('login');
}
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @return mixed
*/
public function handle($request, Closure $next, $guard) {
if (Auth::guard($guard)->check() && auth()->user()->active == 0) {
Auth::guard()->logout();
$request->session()->invalidate();
redirect('/login');
}
return $next($request);
}
}
Gracias de antemano.