/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id, GuestsRequest $request) { $user = Guest::findOrFail($id); Log::info(print_r($request->all(), TRUE)); $user->fill($request->all()); $user->password = \Hash::make($request->get('password')); Log::info("Fill exito"); $user->save(); Log::info("Save exito"); $notices = array('Password Cambiado con exito'); return view('auth.reset', compact('notices', 'errors')); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(GuestsRequest $request, $id) { $guest = Guest::find($id); $guest->fill($request->all()); if ($request->file('photo')) { $fileName = 'guest_' . $guest->id . "." . $request->file('photo')->getClientOriginalExtension(); $request->file('photo')->move(base_path() . '/storage/app/images/', $fileName); $guest->photo = '/storage/app/images/' . $fileName; $img = Image::make(base_path() . $guest->photo); $img->resize(250, 250); $img->save(base_path() . '/storage/app/images/' . $fileName); } $guest->save(); return Redirect::route('guests.index')->with('okmessage', 'Data updated'); }