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::where('id',$this->products_id)->value('presentation'), 'fact_sheet' => Product::where('id',$this->products_id)->value('fact_sheet'), 'slug' => $this->slug, 'product_name' => $this->product_name, 'total_deal_size' => $this->total_deal_size, 'minimum_investment' => $this->minimum_investment, 'credit_rating' => $this->credit_rating, 'deal_tenure' => $this->deal_tenure, 'target_irr' => $this->target_irr, 'target_multiple' => $this->target_multiple, 'payout_frequency' => $this->payout_frequency, 'principal_returned_in' => $this->principal_returned_in, 'average_annual_payback' => $this->average_annual_payback, 'security_enhancement' => $this->security_enhancement, 'listing_details' => $this->listing_details, 'minimum_investment_in_int' => $this->minimum_investment_in_int, ]; } }