42 lines
1.6 KiB
PHP
42 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use App\Models\Product;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class VentureDebtResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'products_id' => $this->products_id,
|
|
'presentation' => Product::find($this->products_id)->value('presentation'),
|
|
'fact_sheet' => Product::find($this->products_id)->value('fact_sheet'),
|
|
'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,
|
|
];
|
|
}
|
|
}
|