mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-16 16:37:47 +00:00
28 lines
712 B
PHP
28 lines
712 B
PHP
<?php
|
|
|
|
namespace App\Concerns;
|
|
|
|
use Illuminate\Validation\Rules\Password;
|
|
|
|
trait PasswordValidationRules
|
|
{
|
|
/**
|
|
* Get the validation rules used to validate passwords.
|
|
*
|
|
* @return array<int, \Illuminate\Contracts\Validation\Rule|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, \Illuminate\Contracts\Validation\Rule|array<mixed>|string>
|
|
*/
|
|
protected function currentPasswordRules(): array
|
|
{
|
|
return ['required', 'string', 'current_password'];
|
|
}
|
|
}
|