<?php

namespace App\Http\Requests\Recipes;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'slug' => ['required', 'string', 'max:255', 'unique:recipes,slug'],
            'title' => ['required', 'string', 'max:255'],
            'description' => ['nullable', 'string'],
            'image_url' => ['nullable', 'string', 'max:2048'],
            'ingredients' => ['nullable', 'array'],
            'steps' => ['nullable', 'array'],
            'time_minutes' => ['nullable', 'integer', 'min:0'],
            'difficulty' => ['nullable', 'string', 'max:50'],
            'tags' => ['nullable', 'array'],
        ];
    }
}
