ldc-cocotte/app/Http/Requests/Fo/Customer/UpdatePasswordRequest.php
2026-10-27 09:58:12 +01:00

42 lines
1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Http\Requests\Fo\Customer;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Password;
use Infrastructure\Adapters\Services\AppCustomerAuthService;
class UpdatePasswordRequest extends FormRequest
{
public function __construct(
private readonly AppCustomerAuthService $authService
) {
}
public function authorize(): bool
{
return $this->authService->check();
}
/** @return array<string,mixed> */
public function rules(): array
{
return [
'password_old' => ['required'],
'password' => [
'required',
'required_with:password_confirmation',
'confirmed',
'max:255',
Password::min(8)
->mixedCase()
->letters()
->numbers()
->symbols()
->uncompromised(),
],
];
}
}