feat: add otp sms

This commit is contained in:
2026-02-18 11:04:47 +03:30
parent bbe70011dc
commit e98c0502db
4 changed files with 84 additions and 7 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace App\Services;
use Illuminate\Support\Facades\Http;
class KavenegarService
{
public function sendVerify(string $mobile, string $token)
{
$apiKey = config('kave.api_key');
if (!$apiKey) {
throw new \Exception('KAVE_API_KEY is null');
}
$url = "https://api.kavenegar.com/v1/{$apiKey}/verify/lookup.json";
$response = Http::timeout(5)->get($url, [
'receptor' => $mobile,
'token' => $token,
'template' => config('kave.template'),
]);
logger()->info('Kavenegar raw', [
'url' => $url,
'status' => $response->status(),
'body' => $response->body(),
]);
return $response->json();
}
}