mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
1dfb75545f
Fetch Currency Rate Logic Class Create Currency Rate Logic Class Update Currency Rate Logic Class Currency Rate Converter Rate
27 lines
615 B
PHP
27 lines
615 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class CurrencyResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'country_id' => $this->country_id,
|
|
'name' => $this->name,
|
|
'short_code' => $this->short_code,
|
|
'symbol' => $this->symbol,
|
|
'currency_rates' => $this->currency_rates()->get()
|
|
];
|
|
}
|
|
}
|