diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index eee9a325..eb73b1cb 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -317,7 +317,7 @@ class AdminController extends Controller 'password' => 'required|min:8|max:16' ]); - $user->changePasswd($request->input('password')); + $user->changePassword($request->input('password')); return json(trans('admin.users.operations.password.success'), 0); diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index a6401b48..a726b9f8 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -209,7 +209,7 @@ class AuthController extends Controller 'password' => 'required|min:8|max:32', ]); - $users->get($uid)->changePasswd($validated['password']); + $users->get($uid)->changePassword($validated['password']); return json(trans('auth.reset.success'), 0); } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 9a83d085..6ad3d4a8 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -137,7 +137,7 @@ class UserController extends Controller if (! $this->user->verifyPassword($request->input('current_password'))) return json(trans('user.profile.password.wrong-password'), 1); - if ($this->user->changePasswd($request->input('new_password'))) { + if ($this->user->changePassword($request->input('new_password'))) { event(new UserProfileUpdated($action, $this->user)); session()->flush(); diff --git a/app/Models/User.php b/app/Models/User.php index c129fafe..bef46570 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -144,7 +144,7 @@ class User extends Model * @param string $new_passwd New password that will be set. * @return bool */ - public function changePasswd($new_passwd) + public function changePassword($new_passwd) { $responses = event(new EncryptUserPassword($new_passwd, $this)); diff --git a/tests/AuthControllerTest.php b/tests/AuthControllerTest.php index baf0e96e..bd0215bb 100644 --- a/tests/AuthControllerTest.php +++ b/tests/AuthControllerTest.php @@ -24,7 +24,7 @@ class AuthControllerTest extends TestCase $this->expectsEvents(Events\UserLoggedIn::class); $user = factory(User::class)->create(); - $user->changePasswd('12345678'); + $user->changePassword('12345678'); $player = factory(App\Models\Player::class)->create( [ 'uid' => $user->uid diff --git a/tests/UserControllerTest.php b/tests/UserControllerTest.php index 7920243b..56bf3609 100644 --- a/tests/UserControllerTest.php +++ b/tests/UserControllerTest.php @@ -106,7 +106,7 @@ class UserControllerTest extends TestCase public function testHandleProfile() { $user = factory(User::class)->create(); - $user->changePasswd('12345678'); + $user->changePassword('12345678'); // Invalid action $this->actAs($user)