Advertisement
Guest User

Untitled

a guest
Jan 14th, 2014
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. $user = User::findOrFail($id);
  2.  
  3. if ($user->exists)
  4. {
  5.     $user::$rules['password'] = (Input::get('password')) ? 'required|confirmed' : '';
  6.     $user::$rules['password_confirmation'] = (Input::get('password')) ? 'required' : '';
  7. }
  8.  
  9. if ($user->updateUniques())
  10. {
  11.     Session::flash('successes', array_merge((array) Session::get('successes'), ['Pomyślnie zmieniono użytkownika']));
  12.     return Redirect::route('users.show', ['users'   =>  $user->id]);
  13. }
  14.  
  15. return Redirect::route('users.edit', ['users'   =>  $user->id])
  16.     ->withErrors($user->errors())
  17.     ->withInput(Input::except('password'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement