Blame view

app/Http/Requests/FaqActionRequest.php 428 Bytes
77ece5578   Fedor   task-132687 FAQ p...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  <?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)],
          ];
      }
  }