/** * POST update data profile user * @param UpdateProfile $request [description] * @return [type] [description] */ public function update_profile(UpdateProfile $request) { //update tabel mst_user $u = User::findOrFail(\Auth::user()->id); $u->nama = $request->nama; $u->save(); //update tabel mst_data_user $du = $this->data_user->find(\Auth::user()->data_user->id); $du->tempat_lahir = $request->tempat_lahir; $du->tgl_lahir = $request->tgl_lahir; $du->jenis_kelamin = $request->jenis_kelamin; $du->save(); return 'ok'; }
public function update(updateUser $request, User $mst_user, DataUser $mst_data_user) { $u = $mst_user->findOrFail($request->mst_user_id); $u->email = $request->email; $u->nama = $request->nama; $u->ref_user_level_id = $request->ref_user_level_id; $u->save(); $du = $mst_data_user->where('mst_user_id', '=', $request->mst_user_id)->first(); $du->jenis_kelamin = $request->jenis_kelamin; $du->tempat_lahir = $request->tempat_lahir; $du->tgl_lahir = $request->tgl_lahir; $du->save(); return 'ok'; }