for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Facades\App\Services\WhichPortal;
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 (WhichPortal::isManagerPortal()) {
return route('manager.login');
route
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
return /** @scrutinizer ignore-call */ route('manager.login');
} elseif (WhichPortal::isHrPortal()) {
return route('hr_advisor.login');
} else {
return route('login');
}