mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-25 07:24:05 +00:00
27 lines
574 B
PHP
27 lines
574 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class AirShipmentItemPriceResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request): array
|
|
{
|
|
$object = $this->resource;
|
|
$detailsArray = (array)json_decode($object['details']);
|
|
|
|
return [
|
|
'name' => $detailsArray['name'],
|
|
'details' => $object['details'],
|
|
];
|
|
}
|
|
}
|