Просмотр файла app/Http/Requests/StoreUserFieldRequest.php

Размер файла: 602B
  1. <?php
  2.  
  3. namespace App\Http\Requests;
  4.  
  5. use App\Models\UserField;
  6. use Illuminate\Foundation\Http\FormRequest;
  7.  
  8. class StoreUserFieldRequest extends FormRequest
  9. {
  10. /**
  11. * Get the validation rules that apply to the request.
  12. *
  13. * @return array
  14. */
  15. public function rules()
  16. {
  17. return [
  18. '_token' => 'in:' . csrf_token(),
  19. 'type' => 'in:' . implode(',', UserField::TYPES),
  20. 'name' => 'required|max:50',
  21. 'min' => 'required',
  22. 'max' => 'required',
  23. 'required' => 'boolean'
  24. ];
  25. }
  26. }