Files
izyim/app/Http/Resources/Package.php
T
Omair Saleh 919e0252f7 large commit
2019-06-03 10:29:08 +08:00

27 lines
616 B
PHP

<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class Package extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'description' => $this->description,
'type' => (int)$this->type,
'width' => (float)$this->width,
'length' => (float)$this->length,
'height' => (float)$this->height,
'quantity' => (int)$this->quantity
];
}
}