customer = $customer; } /** * Transform the resource into an array. * * @param \Illuminate\Http\Request $request * @return array */ // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass public function toArray($request) { $crmCustomer = (object)$this->customer->apiData; return [ 'crm_id' => $this->customer->crm_id, 'firstname' => $crmCustomer->firstname, 'lastname' => $crmCustomer->lastname, 'optin' => null, 'birthdate' => null, 'phone' => $crmCustomer->phone, 'address' => $crmCustomer->address, 'address2' => null, 'city' => $crmCustomer->city, 'postcode' => $crmCustomer->postcode ]; } }