<?php

namespace App\Http\Requests\Families;

use App\Http\Requests\ApiFormRequest;

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

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

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