model = $model; } public function updateCustomer($id, $data) { $this->model = Customer::findOrFail($id); $fill = [ 'salutation_id' => $data['salutation_id'], 'name' => $data['name'], 'firstname' => $data['firstname'], 'street' => $data['street'], 'zip' => $data['zip'], 'city' => $data['city'], 'email' => $data['email'], 'phone' => $data['phone'], 'phonemobile' => $data['phonemobile'], 'country_id' => $data['country_id'], ]; $this->model->fill($fill); $this->model->save(); return $this->model; } public function updateCustomerFromLead($id, $data){ $lead = Lead::findOrFail($id); if(isset($data['customer']) && $lead->customer){ return $this->updateCustomer($lead->customer->id, $data['customer']); } } }