Rename method on User model

This commit is contained in:
Pig Fang 2018-07-19 10:31:44 +08:00
parent 3c24a166e8
commit fa1c780786
6 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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);
}

View File

@ -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();

View File

@ -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));

View File

@ -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

View File

@ -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)