public function post_edit_password($id) { $rules = array('newpass' => 'required'); $errmsg = array('newpass.required' => 'You must provide a new password for the user.'); $validator = Validator::make(Input::all(), $rules, $errmsg); if ($validator->fails()) { return Redirect::back()->withErrors($validator); } $user = User::find($id); $user->password = Hash::make(Input::get('newpass')); $user->save(); return Redirect::back()->withSuccess('The users password has been updated successfully.'); }
public function createAdminUser(array $user) { $adminUser = new User(array('username' => $user['username'], 'email' => $user['email'], 'password' => Hash::make($user['password']))); $adminUser->save(); }