customer = $customer; } /** * Transform the resource into an array. * * @param mixed $request * @return array * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass */ public function toArray($request) { /** @var \LDC\LDCCRM\Models\Customer */ $crmCustomer = (object)$this->customer->apiData; return [ 'hashcode' => $this->customer->hashcode, 'firstname' => $crmCustomer->firstname, 'lastname' => $crmCustomer->lastname, 'opt_in' => $crmCustomer->opt_in, 'birthdate' => $crmCustomer->birth_date, 'phone' => $crmCustomer->phone, 'address' => $crmCustomer->address, 'address2' => $crmCustomer->address2, 'city' => $crmCustomer->city, 'postcode' => $crmCustomer->postcode ]; } }