| 1234567891011121314151617181920212223242526272829 |
- <?php
-
- namespace App\Concerns;
-
- use Illuminate\Contracts\Validation\ValidationRule;
- use Illuminate\Validation\Rules\Password;
-
- trait PasswordValidationRules
- {
- /**
- * Get the validation rules used to validate passwords.
- *
- * @return array<int, Password|ValidationRule|array<mixed>|string>
- */
- protected function passwordRules(): array
- {
- return ['required', 'string', Password::default(), 'confirmed'];
- }
-
- /**
- * Get the validation rules used to validate the current password.
- *
- * @return array<int, Password|ValidationRule|array<mixed>|string>
- */
- protected function currentPasswordRules(): array
- {
- return ['required', 'string', 'current_password'];
- }
- }
|