trypost/app/Concerns/PasswordValidationRules.php

32 lines
714 B
PHP
Raw Permalink Normal View History

2026-01-15 01:13:44 +00:00
<?php
declare(strict_types=1);
2026-01-15 01:13:44 +00:00
namespace App\Concerns;
use Illuminate\Contracts\Validation\Rule;
2026-01-15 01:13:44 +00:00
use Illuminate\Validation\Rules\Password;
trait PasswordValidationRules
{
/**
* Get the validation rules used to validate passwords.
*
* @return array<int, Rule|array<mixed>|string>
2026-01-15 01:13:44 +00:00
*/
protected function passwordRules(): array
{
return ['required', 'string', Password::default(), 'confirmed'];
}
/**
* Get the validation rules used to validate the current password.
*
* @return array<int, Rule|array<mixed>|string>
2026-01-15 01:13:44 +00:00
*/
protected function currentPasswordRules(): array
{
return ['required', 'string', 'current_password'];
}
}