public function update(Store $store) { $user = User::find($store->user_id); $phone_number = User::decodePhoneNumber($store->phone_number ? $store->phone_number : $user->phone_number); $address = User::decodeAddress($store->address ? $store->address : $user->address); return $this->viewUserStore(compact('store', 'phone_number', 'address')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(User $user) { return view('edit-profile')->withUser($user)->withPhoneNumber(User::decodePhoneNumber($user->phone_number))->withAddress(User::decodeAddress($user->address))->withAreaCodes(collect(User::areaCodes()))->withStates($user->getStatesPaginated(10))->withPostCodes($user->getPostCodesPaginated(10)); }