<?php

namespace App\Http\Requests\Member;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Password;

// ══════════════════════════════════════════════════════════════════
//  InPractice — UpdatePasswordRequest
//  Location: app/Http/Requests/Member/UpdatePasswordRequest.php
// ══════════════════════════════════════════════════════════════════

class UpdatePasswordRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'current_password' => ['required', 'string'],
            'password'         => ['required', 'string', 'confirmed', Password::min(8)],
        ];
    }

    public function messages(): array
    {
        return [
            'current_password.required' => __('profile.validation_current_password_required'),
            'password.required'         => __('profile.validation_password_required'),
            'password.confirmed'        => __('profile.validation_password_confirmed'),
            'password.min'              => __('profile.validation_password_min'),
        ];
    }
}
