id", $code, now()->addMinutes((int) config('auth.otp_lifespan', '10'))); return $code; } public function verify(User $user, string $otp): bool { $code = Cache::get("otp_$user->id"); if ($code === $otp) { Cache::forget("otp_$user->id"); return true; } return false; } }