products_id)->get(); $imagePaths = []; if (!empty($images)) { foreach ($images as $imageItem) { $path = asset('public/' . $imageItem['images']); $imagePaths[] = $path; } } return [ 'id' => $this->id, 'products_id' => $this->products_id, 'product_images' => $imagePaths, 'presentation' => Product::find($this->products_id) ? Product::find($this->products_id)->value('presentation') : null, 'fact_sheet' => Product::find($this->products_id) ? Product::find($this->products_id)->value('fact_sheet') : null, 'slug' => $this->slug, 'issuer' => $this->issuer, 'fund_name' => $this->fund_name, 'fund_type' => $this->fund_type, 'about_issuer' => $this->about_issuer, 'fund_description' => $this->fund_description, 'sharpe_ratio' => $this->sharpe_ratio, 'annualized_volatility' => $this->annualized_volatility, 'max_dropdown' => $this->max_dropdown, 'isin' => $this->isin, 'inception_date' => $this->inception_date, 'fund_aum' => $this->fund_aum, 'expense_ratio' => $this->expense_ratio, 'nav_per_unit' => $this->nav_per_unit, 'minimum_investment' => $this->minimum_investment, 'ytd' => $this->ytd, 'year1_return' => $this->year1_return, 'year3_return' => $this->year3_return, 'returns' => $this->returns, // 'product_images' => ProductImage::where('product_xid',$this->products_id)->get(), ]; } }