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::where('id',$this->products_id)->value('presentation') : null, 'fact_sheet' => Product::find($this->products_id) ? Product::where('id',$this->products_id)->value('fact_sheet') : null, 'company_name' => $this->company_name, 'slug' => $this->slug, 'sector' => $this->sector, 'minimum_investment' => $this->minimum_investment, 'tenure' => $this->tenure, 'total_issue_size' => $this->total_issue_size, 'interest_payout' => $this->interest_payout, 'principal_payout' => $this->principal_payout, 'expected_return' => $this->expected_return, 'collateral_cover_multiple' => $this->collateral_cover_multiple, 'about_company' => $this->about_company, 'instrument_type' => $this->instrument_type, 'face_per_value_unit' => $this->face_per_value_unit, 'prepayment_covenants' => $this->prepayment_covenants, 'source_of_funds_repayment_debt' => $this->source_of_funds_repayment_debt, 'minimum_investment_in_int' => $this->minimum_investment_in_int, ]; } }