App\Http\Middleware\LoginAs::getUser PHP Method

getUser() protected method

protected getUser ( string $identifier ) : Illuminate\Contracts\Auth\Authenticatable
$identifier string
return Illuminate\Contracts\Auth\Authenticatable
    protected function getUser(string $identifier) : Authenticatable
    {
        if (!str_contains($identifier, '@')) {
            $identifier .= '@spatie.be';
        }
        if (request()->isBack()) {
            return BackUser::where(['email' => $identifier])->first();
        }
        return FrontUser::where(['email' => $identifier])->first();
    }