public function toArray($request): array 	{ 		$lang = $request->lang; 		$discount = $this->getDiscount(); 		$discountPrice = $this->applyDiscount($discount);  		return [ 			'id' => $this->id, 			'type' => $this->type, 			'class_name' => 'Product', 			'currency' => Setting::getMainCurrency(), 			'name' => $this->getTranslationIfExistsOrGiveNull($lang, 'name'), 			'slug' => $this->determineTranslation($lang, 'slug'), 			'description' => $this->getTranslationIfExistsOrGiveNull($lang, 'description'), 			'short_description' => $this->determineTranslation($lang, 'short_description'), 			'price' => $this->price, 			'price_with_discount' => $discountPrice ? number_format((float) $discountPrice, 2) : null, 			'price_per_unit_of_measure' => $this->price_per_unit_of_measure, 			'second_price_per_unit_of_measure' => $this->getSecondPrice((string) $this->price_per_unit_of_measure), 			'alternative_unit_of_measure' => $this->alternative_unit_of_measure, 			'availability' => $this->availabilityStatus(), 			'variant_label' => $this->determineTranslation($lang, 'variant_label'), 			'second_price' => $this->getSecondPrice($this->price), 			'second_price_with_discount' => $this->getSecondPrice($discountPrice), 			'lowest_price' => $this->lowest_price, 			'vat_rate' => $this->getVatRate(), 			'code' => $this->code, 			'harvest' => $this->harvest, 			'weight' => $this->weight, 			'applied_discount' => new DiscountResource($discount), 			'product_categories' => ProductCategoryResource::collection($this->productCategories), 			'piktograms' => $this->fetchPiktograms($discount), 			'variants' => ProductVariantResource::collection($this->variants), 			'media' => $this->storage()->getFirstThumb('images'), 			'rating' => $this->reviews_avg_rating ? round($this->reviews_avg_rating, 2) : null, 			'user_liked' => $this->hasUserLiked(), 			'unit_of_measure' => $this->unit_of_measure ? Product::MEASURE_UNITS[$this->unit_of_measure] : null, 			'reviews_count' => $this->reviewsCount(), 			'created_at' => formatTimestamp($this->created_at), 			'updated_at' => formatTimestamp($this->updated_at), 		]; 	}