allowedMimeTypes(), ...MediaType::Video->allowedMimeTypes(), ...MediaType::Document->allowedMimeTypes()]; return [ // Use the largest per-type cap as the upper bound; per-type // enforcement happens after the upload via the Media model. 'media' => [ 'required', 'file', 'max:'.MediaType::Video->maxSizeInKb(), 'mimetypes:'.implode(',', $allowedMimes), ], 'meta' => ['sometimes', 'array'], 'meta.width' => ['sometimes', 'integer', 'min:1'], 'meta.height' => ['sometimes', 'integer', 'min:1'], 'meta.duration' => ['sometimes', 'numeric', 'min:0'], ]; } }