<?php

namespace App\Http\Requests\Admin\Academy;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'game_id'           => ['required', 'integer', 'exists:games,id'],
            'name'              => ['required', 'array'],
            'name.en'           => ['required', 'string', 'max:255'],
            'name.ar'           => ['nullable', 'string', 'max:255'],
            'description'       => ['nullable', 'array'],
            'description.en'    => ['nullable', 'string'],
            'description.ar'    => ['nullable', 'string'],
            'image'             => ['required', 'image', 'mimes:jpeg,png,jpg,gif,webp', 'max:2048'],
            'is_active'         => ['nullable', 'boolean'],
            'coaches'            => ['nullable', 'array'],
            'coaches.*'          => ['integer', 'exists:coaches,id'],
        ];
    }
}
