39 lines
1.3 KiB
PHP
39 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use App\Models\Product;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
|
|
class LeaseBasedFinancingResource 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' => $this->company,
|
|
'slug' => $this->slug,
|
|
'asset_class' => $this->asset_class,
|
|
'underlying_asset' => $this->underlying_asset,
|
|
'sector' => $this->sector,
|
|
'mobility_platform' => $this->mobility_platform,
|
|
'total_deal_size' => $this->total_deal_size,
|
|
'minimum_investment' => $this->minimum_investment,
|
|
'tenure' => $this->tenure,
|
|
'payout_frequency' => $this->payout_frequency,
|
|
'pre_tax_return' => $this->pre_tax_return,
|
|
'minimum_investment_in_int' => $this->minimum_investment_in_int,
|
|
];
|
|
}
|
|
}
|