<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class UpdateQuestionSetRequest extends FormRequest
{
    public function authorize(): bool
    {
        return auth()->check();
    }

    public function rules(): array
    {
        return [
            'editid' => ['required', 'integer', 'exists:questionsetup,id'],
            'questiontitle' => ['required', 'string', 'max:2000', Rule::unique('questionsetup', 'questionsettitle')->ignore($this->integer('editid'))],
            'questionsetgk' => ['required', 'string', 'max:255'],
            'questionsetnscince' => ['required', 'string', 'max:255'],
            'questionsetnhindi' => ['required', 'string', 'max:255'],
            'questionsetenglish' => ['required', 'string', 'max:255'],
            'questionsetmath' => ['required', 'string', 'max:255'],
        ];
    }
}
