call wac webhook

This commit is contained in:
edmondlang
2024-07-06 11:24:54 +08:00
parent d4dcae155d
commit 0c9ffd2bf7
2 changed files with 19 additions and 0 deletions
@@ -36,6 +36,8 @@ use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
class CreateCustomerLogic extends AbstractControllerLogic
{
@@ -167,6 +169,18 @@ class CreateCustomerLogic extends AbstractControllerLogic
CreatePerfexCRMCustomer::dispatch($createLeadPerfexCRMObject);
}
if(!app()->environment(['production'])){
// call wac webhook
$url = 'https://wacontact.readyspace.com/rest/trigger/9fe03daf-2ace-4095-b064-601ef6d9bfe7';
$payload = [
'name' => $request->input('name'),
'email' => $request->input('email'),
'phone' => $request->input('phone'),
];
$response = Http::post($url, $payload);
Log::channel('wac_webhook')->info(json_encode($response));
}
// $this->generateEmailVerificationAttemptProcessor->execute($user);
return $this->response($this->authenticationProcessor->execute($request));
+5
View File
@@ -130,6 +130,11 @@ return [
'path' => storage_path('logs/laravel_perfex_crm.log'),
'level' => 'info',
],
'wac_webhook' => [
'driver' => 'single',
'path' => storage_path('logs/wac_webhook.log'),
'level' => 'info',
],
],
];