validation added in video upload
This commit is contained in:
parent
ee7973aac2
commit
56f1c2eb95
|
|
@ -50,7 +50,7 @@
|
|||
<label class="image-item" v-bind:class="{ 'has-image': videoData.length > 0 }">
|
||||
<input type="hidden" :name="'videos[' + video.id + ']'" v-if="! new_video"/>
|
||||
|
||||
<input type="file" accept="video/*" :name="'videos[]'" ref="videoInput" :id="_uid" @change="addVideoView($event)" multiple="multiple"/>
|
||||
<input type="file" v-validate="'mimes:video/*'" accept="video/*" :name="'videos[]'" ref="videoInput" :id="_uid" @change="addVideoView($event)" multiple="multiple"/>
|
||||
|
||||
<video class="preview" v-if="videoData.length > 0" width="200" height="160" controls>
|
||||
<source :src="videoData" type="video/mp4">
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ class ProductForm extends FormRequest
|
|||
$this->rules = array_merge($product->getTypeInstance()->getTypeValidationRules(), [
|
||||
'sku' => ['required', 'unique:products,sku,' . $this->id, new \Webkul\Core\Contracts\Validations\Slug],
|
||||
'images.*' => 'nullable|mimes:bmp,jpeg,jpg,png,webp',
|
||||
'videos.*' => 'nullable|mimes:mov,mp4|max:2048',
|
||||
'special_price_from' => 'nullable|date',
|
||||
'special_price_to' => 'nullable|date|after_or_equal:special_price_from',
|
||||
'special_price' => ['nullable', new \Webkul\Core\Contracts\Validations\Decimal, 'lt:price'],
|
||||
|
|
|
|||
Loading…
Reference in New Issue