userDetailz = $detailz; $this->first_name = $detailz->first_name; $this->last_name = $detailz->last_name; $this->email = $detailz->user->email; $this->birthdate = $detailz->birthdate; $this->gender = $detailz->gender; $this->country = $detailz->country; $this->city = $detailz->city; $this->lang = $detailz->lang; $this->weight = $detailz->weight; $this->height = $detailz->height; $this->chest_circumference = $detailz->chest_circumference; $this->waist_circumference = $detailz->waist_circumference; $this->hip_circumference = $detailz->hip_circumference; $this->blood_pressure_up= $detailz->blood_pressure_up; $this->blood_pressure_down = $detailz->blood_pressure_down; $this->has_hypo = $detailz->has_hypo; $this->has_hyper = $detailz->has_hyper; $this->about_alergy = $detailz->about_alergy; $this->about_taking_pils = $detailz->about_taking_pils; $this->about_sport_hobbies = $detailz->about_sport_hobbies; $this->favorite_foods = $detailz->favorite_foods; $this->unfavorite_foods = $detailz->unfavorite_foods; $this->additional_info = $detailz->additional_info; } public function update() { $this->userDetailz->update( $this->except(['userDetailz','email']) ); if ($this->userDetailz->user->email != $this->email) { $this->userDetailz->user->update( ['email' => $this->email] ); } } }