EAN code required otherwise laravel error

This commit is contained in:
S. Hattry 2022-06-21 12:10:06 +00:00 • committed by Jérémy Munsch
parent 5e86a0976f
commit cfb3973639
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
3 changed files with 3 additions and 1 deletions

View file

@ -26,6 +26,7 @@ class StoreProductRequest extends FormRequest
{
return [
'name' => 'required|string|min:2|max:255',
'code_ean' => 'required|numeric',
'picture' => [
'image',
'mimes:jpeg,png,jpg',

View file

@ -26,6 +26,7 @@ class UpdateProductRequest extends FormRequest
{
return [
'name' => 'required|string|min:2|max:255',
'code_ean' => 'required|numeric',
'picture' => [
'image',
'mimes:jpeg,png,jpg',

View file

@ -8,7 +8,7 @@
</div>
<div class="form-group">
<label for="code_ean">Code EAN</label>
<input type="text" id="code_ean" name="code_ean" class="form-control" placeholder="code_ean" value="{{ old('code_ean', $product->code_ean ?? '') }}">
<input type="text" id="code_ean" name="code_ean" class="form-control" placeholder="code_ean" value="{{ old('code_ean', $product->code_ean ?? '') }}" required>
</div>
<div class="form-group">
<label for="picture">Image *<small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('theme.product_image_maxwidth') }} px par {{ Config::get('theme.product_image_maxheight') }} px</small></label></br>