File: /var/www/html/sarvodayahospital/app/LeadSquare.php
<?php
namespace App;
use Illuminate\Http\Client\ConnectionException;
use Illuminate\Support\Facades\Http;
class LeadSquare
{
public function __construct()
{
}
public function CaptureLead($postData)
{
try {
$url = 'http://api-in21.leadsquared.com:80/v2/LeadManagement.svc/Lead.Capture?accesskey=u$rd1ee5420d38698d2bcbba763efc36146&secretkey=dd27a1402a82e9e2ffd239b8a815a4f47e9ac1a7';
// $url = 'http://api-in21.leadsquared.com/v2/LeadManagement.svc/Lead.Capture?accessKey=u$rd1ee5420d38698d2bcbba763efc36146&secretKey=dd27a1402a82e9e2ffd239b8a815a4f47e9ac1a7';
$response = Http::post($url, $postData);
return $response;
} catch (ConnectionException $exception) {
//return json_encode($exception);
return 'Connection not established';
}
}
}