$projectName, 'rel_type' => 'customer', 'billing_type' => 1, 'clientid' => $clientId, 'start_date' => date('Y-m-d'), 'status' => $status ]; $response = Http::asForm()->withHeaders([ 'authtoken' => config('perfexcrm.api_key')]) ->post(config('perfexcrm.base_url').'/api/projects',$data); if($response->successful()){ $data = $response->json(); return (object) $data; }else{ Log::channel('perfex_crm')->info($response); return null; } }catch(\Exception $exception){ throw new MalformedRequestException('Unable to get correct response from Perfex CRM server' . $exception->getMessage()); } } }