This commit is contained in:
baodev0
2026-08-19 11:03:43 +07:00
parent 2deb4ad74e
commit 8d0a5322ea
6 changed files with 209 additions and 1 deletions
@@ -190,7 +190,14 @@ class ClientController extends Controller
*/
public function register(ClientRegisterRequest $request)
{
$result = $this->authService->registerClient($request->validated());
$data = $request->validated();
if (!empty($data['trial_config'])) {
$decoded = json_decode((string) $data['trial_config'], true);
$data['trial_config'] = is_array($decoded) ? $decoded : null;
}
$result = $this->authService->registerClient($data);
$client = $result['client'];
$this->activityLogger->logAuth('register', 'customer', $client->id, $client->email);
@@ -44,6 +44,11 @@ class ClientRegisterRequest extends FormRequest
'min:6',
'confirmed'
],
'trial_config' => [
'nullable',
'string',
],
];
}
+20
View File
@@ -84,6 +84,26 @@ class Telegram
return $this->SendMessage($msg);
}
public function SendTrialRegistration($client, array $trialConfig = [])
{
$msg = "🧪 Khách hàng vừa đăng ký dùng thử Cloud VPS!\n";
$msg .= "--------------------------------\n";
$msg .= "👤 Tên: {$client->fullname}\n";
$msg .= "📧 Email: {$client->email}\n";
$msg .= "📱 SĐT: {$client->phone}\n";
$msg .= "--------------------------------\n";
$msg .= "🖥️ CPU: " . ($trialConfig['cpu'] ?? '-') . "\n";
$msg .= "💾 RAM: " . ($trialConfig['ram'] ?? '-') . "\n";
$msg .= "💽 SSD: " . ($trialConfig['ssd'] ?? '-') . "\n";
$msg .= "🧠 Hệ điều hành: " . ($trialConfig['os'] ?? '-') . "\n";
if (!empty($trialConfig['other'])) {
$msg .= "📝 Yêu cầu khác: {$trialConfig['other']}\n";
}
$msg .= "🕒 Thời gian: " . Carbon::now()->format('d/m/Y H:i:s');
return $this->SendMessage($msg);
}
public function SendManualDepositPendingApproval($customer, $transaction)
{
$msg = "🔔 Yêu cầu nạp tiền chờ duyệt!\n";