mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-08-28 02:57:29 -04:00
37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Modules\StaffPayroll\Transformers;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class InvoiceItemResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
// return parent::toArray($request);
|
|
return [
|
|
'id' => $this->id,
|
|
'invoice' => $this->whenLoaded('invoice'),
|
|
'studio_plus_incentive_id' => $this->studio_plus_incentive_id,
|
|
'studio_plus_video_id' => $this->studio_plus_video_id,
|
|
'incentive' => $this->whenLoaded('incentive'),
|
|
'item_no' => $this->item_no,
|
|
'name' => $this->name,
|
|
'description' => $this->description,
|
|
'issue_date' => $this->issue_date,
|
|
'created_date' => $this->created_at,
|
|
'amount' => $this->amount,
|
|
'range_amount' => $this->range_amount,
|
|
'quantity' => $this->quantity,
|
|
'total' => $this->amount * $this->quantity,
|
|
'type' => $this->type,
|
|
];
|
|
}
|
|
}
|