FaqActionRequest.php 428 Bytes
<?php

namespace App\Http\Requests;

use App\Enums\FaqTarget;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class FaqActionRequest extends FormRequest
{
    public function rules()
    {
        return [
            'question' => 'required|string|max:255',
            'answer' => 'required|string',
            'target' => ['required', 'string', Rule::enum(FaqTarget::class)],
        ];
    }
}