diff --git a/app/Http/Requests/ProductSaveRequest.php b/app/Http/Requests/ProductSaveRequest.php index d1c3949..774880f 100755 --- a/app/Http/Requests/ProductSaveRequest.php +++ b/app/Http/Requests/ProductSaveRequest.php @@ -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'], diff --git a/app/Observers/ProductObserver.php b/app/Observers/ProductObserver.php index 471e9c9..70e8696 100755 --- a/app/Observers/ProductObserver.php +++ b/app/Observers/ProductObserver.php @@ -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; diff --git a/resources/views/admin/setting.blade.php b/resources/views/admin/setting.blade.php index a1cd741..7d654d7 100755 --- a/resources/views/admin/setting.blade.php +++ b/resources/views/admin/setting.blade.php @@ -20,60 +20,63 @@ @switch($set->type) @case('longtext') - - @break + + @break @case('checkbox') -
-
+
+
+
+
+ +
+
+ +
-
- -
-
- -
-
- @break + @break @case('code') - - @break + + @break @case('editor') - - @break + + @break @case('category') - - @break + + @break @case('cat') - - @break + + @break @case('image') - cover - - @break + cover + + @break @default - + @endswitch
@@ -82,8 +85,8 @@ @endforeach
  • - - + +