<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'categories' => 'required|array|min:1',

            'categories.*.id' => 'required|exists:categories,id',

            'categories.*.display_order' => 'required|integer|min:1',
        ];
    }
}