picture) { $product->picture = Utils::storeImage($product->picture, $product->getTable()); } if ($product->banner) { $product->banner = Utils::storeImage($product->banner, $product->getTable()); } }); static::updating(function (Product $product) { if ($product->picture) { $product->picture = Utils::storeImage($product->picture, $product->getTable()); } if ($product->banner) { $product->banner = Utils::storeImage($product->banner, $product->getTable()); } }); parent::boot(); } /** * Get the Range that owns the product. */ public function gamme() { return $this->belongsTo(Gamme::class); } }