diff --git a/app/Http/Controllers/WebsiteController.php b/app/Http/Controllers/WebsiteController.php index 17a066a..dcc85bf 100755 --- a/app/Http/Controllers/WebsiteController.php +++ b/app/Http/Controllers/WebsiteController.php @@ -663,8 +663,10 @@ class WebsiteController extends Controller ->get(); foreach ($qs as $q){ $p = Product::whereId($q->product_id)->first(); - $p->stock_quantity = $q->count; - $p->save(); + if ($p != null){ + $p->stock_quantity = $q->count; + $p->save(); + } } return 'Done!'; } diff --git a/resources/views/component/card-quantity.blade.php b/resources/views/component/card-quantity.blade.php index fef9395..11a0d00 100755 --- a/resources/views/component/card-quantity.blade.php +++ b/resources/views/component/card-quantity.blade.php @@ -1,7 +1,7 @@ -