43 lines
1.6 KiB
PHP
43 lines
1.6 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Resources;
|
||
|
|
|
||
|
|
use App\Models\Product;
|
||
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||
|
|
|
||
|
|
class HighYieldFinanceResource 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 parent::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'),
|
||
|
|
'slug' => $this->slug,
|
||
|
|
'security_name' => $this->security_name,
|
||
|
|
'security_type' => $this->security_type,
|
||
|
|
'isin' => $this->isin,
|
||
|
|
'issuer_company' => $this->issuer_company,
|
||
|
|
'issue_size' => $this->issue_size,
|
||
|
|
'issue_type' => $this->issue_type,
|
||
|
|
'listing_details' => $this->listing_details,
|
||
|
|
'rating_category' => $this->rating_category,
|
||
|
|
'minimum_investment' => $this->minimum_investment,
|
||
|
|
'coupon_rate' => $this->coupon_rate,
|
||
|
|
'yield_to_maturity' => $this->yield_to_maturity,
|
||
|
|
'interest_payment_frequency' => $this->interest_payment_frequency,
|
||
|
|
'allotment_date' => $this->allotment_date,
|
||
|
|
'maturity_date' => $this->maturity_date,
|
||
|
|
'minimum_investment_in_int' => $this->minimum_investment_in_int,
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|