> */ public function rules(): array { return [ 'password' => [ 'required', 'string', ], ]; } /** * @return array */ public function after(): array { return [ function (Validator $validator): void { if ($validator->errors()->has('password')) { return; } $user = $this->user(); $password = $this->input('password'); if (! is_string($password) || $user === null || ! Hash::check($password, (string) $user->password)) { $validator->errors()->add('password', __('The password is incorrect.')); } }, ]; } }