<?php

namespace App\Http\Requests\Families;

use App\Http\Requests\ApiFormRequest;

class GuardiansByFamilyRequest extends ApiFormRequest
{
    protected function prepareForValidation(): void
    {
        parent::prepareForValidation();
        $this->merge(['family_id' => $this->route('familyId')]);
    }

    public function authorize(): bool
    {
        return auth()->check();
    }

    public function rules(): array
    {
        return [
            'family_id' => ['required', 'integer', 'min:1'],
        ];
    }
}
