<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UpdateFishRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, mixed>
     */
    public function rules()
    {
        return [
            'name' => 'required|string|max:255|unique:fishes,name,'.$this->fish,
            'type' => 'required|integer|exists:fish_types,id',
            'image' => 'nullable|max:4000|mimes:jpeg,bmp,png,jpg,svg',
            'description' => 'required|string|max:5000',
            'content' => 'nullable|max:500000',
            'status' => 'required|integer|in:0,1',
        ];
    }
}
