@ -30,6 +30,7 @@ class ProductSaveRequest extends FormRequest
//
// 'name' => ['required', 'string', 'min:5', 'max:128','unique:products,name,'.$this->name],
'name' => ['required', 'string', 'min:5', 'max:128',Rule::unique('products')->ignore($this->id)],
'sku' => ['nullable', 'string', 'min:1', 'max:128',Rule::unique('products')->ignore($this->id)],
'body' => ['nullable', 'string', 'min:5'],
'excerpt' => ['required', 'string', 'min:5'],
'active'=>['nullable','boolean'],
@ -10,7 +10,7 @@ class ProductObserver
public function updated(Product $product){
\Log::info('product update');
if ($product->wasChanged('price')){
if ($product->wasChanged('price') && $p->price != null){
\Log::info('product price update');
$p = new Price();
$p->product_id = $product->id;
@ -29,13 +29,15 @@
</div>
<div class="col-md">
<label>
<input type="radio" name="{{$set->key}}" @if($set->value == 'yes') checked @endif value="yes">
<input type="radio" name="{{$set->key}}"
@if($set->value == 'yes') checked @endif value="yes">
{{__("Yes")}}
</label>
<input type="radio" name="{{$set->key}}" value="no" @if($set->value == 'no') checked @endif>
<input type="radio" name="{{$set->key}}" value="no"
@if($set->value == 'no') checked @endif>
{{__("No")}}
@ -66,7 +68,8 @@
</select>
@break
@case('image')
<img src="{{asset('images/'.str_replace('_','.',$set->key))}}" style="max-height: 150px" alt="cover">
<img src="{{asset('images/'.str_replace('_','.',$set->key))}}?{{time()}}"
class="img-fluid" style="max-height: 150px;max-width: 45%" alt="cover">
<input type="file" name="pic[{{$set->key}}]" id="{{$set->key}}"
accept="image/*"
class="form-control-file"/>