header('Authorization'); $authDecode = base64_decode(\str_replace('Basic ', '', $auth)); $authCreds = \explode(':', $authDecode); $check = ($authCreds[0] ?? '') === config('mailjet.login'); $check = $check && (($authCreds[1] ?? '') === config('mailjet.password')); if (!$check) { throw new BadRequestHttpException(); } return $next($request); } }