2024-03-28 14:52:40 +05:30
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
|
|
|
|
|
|
use App\Models\Product;
|
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
2024-04-12 15:07:34 +05:30
|
|
|
use App\Models\ProductImage;
|
2024-03-28 14:52:40 +05:30
|
|
|
class DebtFundResource extends JsonResource
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Transform the resource into an array.
|
|
|
|
|
*
|
|
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
|
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
|
|
|
|
*/
|
|
|
|
|
public function toArray($request)
|
|
|
|
|
{
|
2024-04-12 15:07:34 +05:30
|
|
|
$images = ProductImage::where('product_xid', $this->products_id)->get();
|
|
|
|
|
$imagePaths = [];
|
|
|
|
|
if (!empty($images)) {
|
|
|
|
|
foreach ($images as $imageItem) {
|
|
|
|
|
$path = asset('public/' . $imageItem['images']);
|
|
|
|
|
$imagePaths[] = $path;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2024-03-28 14:52:40 +05:30
|
|
|
return [
|
|
|
|
|
'id' => $this->id,
|
|
|
|
|
'products_id' => $this->products_id,
|
2024-04-12 15:07:34 +05:30
|
|
|
'product_images' => $imagePaths,
|
2024-04-30 11:02:34 +05:30
|
|
|
'presentation' => Product::where('id',$this->products_id)->value('presentation'),
|
|
|
|
|
'fact_sheet' => Product::where('id',$this->products_id)->value('fact_sheet'),
|
2024-03-28 14:52:40 +05:30
|
|
|
'fund_name' => $this->fund_name,
|
|
|
|
|
'slug' => $this->slug,
|
|
|
|
|
'registration_number' => $this->registration_number,
|
|
|
|
|
'fund_category' => $this->fund_category,
|
|
|
|
|
'fund_structure' => $this->fund_structure,
|
|
|
|
|
'fund_strategy' => $this->fund_strategy,
|
|
|
|
|
'fund_domicile' => $this->fund_domicile,
|
|
|
|
|
'fund_manager_name' => $this->fund_manager_name,
|
|
|
|
|
'website_of_the_fund' => $this->website_of_the_fund,
|
|
|
|
|
'fund_manager_experience' => $this->fund_manager_experience,
|
|
|
|
|
'sponsor' => $this->sponsor,
|
|
|
|
|
'manager' => $this->manager,
|
|
|
|
|
'trustee' => $this->trustee,
|
|
|
|
|
'auditor' => $this->auditor,
|
|
|
|
|
'valuer_tax_advisor' => $this->valuer_tax_advisor,
|
|
|
|
|
'credit_rating' => $this->credit_rating,
|
|
|
|
|
'open_date' => $this->open_date,
|
|
|
|
|
'first_close_date' => $this->first_close_date,
|
|
|
|
|
'final_close_date' => $this->final_close_date,
|
|
|
|
|
'tenure_from_final_date' => $this->tenure_from_final_date,
|
|
|
|
|
'commitment_period' => $this->commitment_period,
|
|
|
|
|
'native_currency' => $this->native_currency,
|
|
|
|
|
'target_corpus' => $this->target_corpus,
|
|
|
|
|
'investment_manager_contribution' => $this->investment_manager_contribution,
|
|
|
|
|
'minimum_capital_commitment' => $this->minimum_capital_commitment,
|
|
|
|
|
'intial_drawdown' => $this->intial_drawdown,
|
|
|
|
|
'target_irr' => $this->target_irr,
|
|
|
|
|
'accepting_overseas_investment' => $this->accepting_overseas_investment,
|
|
|
|
|
'management_fees_and_carry' => $this->management_fees_and_carry,
|
|
|
|
|
'hurdle_rate' => $this->hurdle_rate,
|
|
|
|
|
'other_expenses' => $this->other_expenses,
|
|
|
|
|
'focused_sectors_industries' => $this->focused_sectors_industries
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|