<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [

            'category_name' => 'required|string|max:150',

            'parent_id' => 'nullable|exists:categories,id', 

            'status' => 'required|boolean',

            'category_icon' => 'nullable|image|mimes:jpg,jpeg,png,svg|max:2048'

        ];
    }
}