You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
925 B

  1. <?php
  2. namespace App\Http\Requests;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class FileUpdateRequest extends FormRequest
  5. {
  6. /**
  7. * Determine if the user is authorized to make this request.
  8. *
  9. * @return bool
  10. */
  11. public function authorize()
  12. {
  13. return true;
  14. }
  15. /**
  16. * Get the validation rules that apply to the request.
  17. *
  18. * @return array<string, mixed>
  19. */
  20. public function rules()
  21. {
  22. return [
  23. "alts" => [app()->collection->alt_required ? "required" : "nullable", 'array'],
  24. "alts.*" => [app()->collection->alt_required ? "required" : "nullable", 'max:1000'],
  25. "description" => [app()->collection->description_required ? "required" : "nullable", 'max:300'],
  26. 'original_name' => ["string", "nullable", 'max:300'],
  27. 'published_at' => ['date_format:Y-m-d H:i:s', 'nullable'],
  28. ];
  29. }
  30. }