1 | <?php |
||||||||
2 | |||||||||
3 | namespace Enomotodev\LaractiveAdmin\Http\Middleware; |
||||||||
4 | |||||||||
5 | use Closure; |
||||||||
6 | use Illuminate\Auth\AuthenticationException; |
||||||||
7 | use Illuminate\Auth\Middleware\Authenticate; |
||||||||
8 | |||||||||
9 | class LaractiveAdminAuthenticate extends Authenticate |
||||||||
10 | { |
||||||||
11 | /** |
||||||||
12 | * @param \Illuminate\Http\Request $request |
||||||||
13 | * @param Closure $next |
||||||||
14 | * @param mixed ...$guards |
||||||||
15 | * @return \Illuminate\Http\RedirectResponse|mixed |
||||||||
16 | */ |
||||||||
17 | 8 | public function handle($request, Closure $next, ...$guards) |
|||||||
18 | { |
||||||||
19 | try { |
||||||||
20 | 8 | if ((float) str_limit(app()->version(), 3, '') >= 5.7) { |
|||||||
0 ignored issues
–
show
introduced
by
![]() |
|||||||||
21 | $this->authenticate($request, ['laractive-admin']); |
||||||||
22 | } else { |
||||||||
23 | 8 | parent::authenticate(['laractive-admin']); |
|||||||
0 ignored issues
–
show
array('laractive-admin') of type array<integer,string> is incompatible with the type Illuminate\Http\Request expected by parameter $request of Illuminate\Auth\Middlewa...nticate::authenticate() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() The call to
Illuminate\Auth\Middlewa...nticate::authenticate() has too few arguments starting with guards .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above. ![]() |
|||||||||
24 | } |
||||||||
25 | 1 | } catch (AuthenticationException $e) { |
|||||||
26 | 1 | return redirect()->guest(route('admin.login')); |
|||||||
27 | } |
||||||||
28 | |||||||||
29 | 7 | return $next($request); |
|||||||
30 | } |
||||||||
31 | } |
||||||||
32 |