1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
-
- namespace App\Http\Resources;
-
- use Illuminate\Http\Resources\Json\JsonResource;
-
- class CompoundResource extends JsonResource
- {
- /**
- * Transform the resource into an array.
- *
- * @param \Illuminate\Http\Request $request
- * @return array
- */
- public function toArray($request)
- {
- return [
- '_id' => $this->_id,
- 'jenis' => $this->jenis,
- 'kpd' => $this->kpd,
- 'no_plate' => $this->no_plate,
- 'nric' => $this->identity,
- 'no_daftar_syarikat' => $this->no_daftar_syarikat,
- 'nama' => $this->nama,
- 'tarikh_masa' => $this->created_at->format('d/m/Y H:i:s A'),
- 'kesalahan' => $this->faulty,
- 'enforcer' => $this->staffdetail,
- 'status' => $this->status,
- 'jumlah_asal_kompaun' => $this->jumlah_asal_kompaun,
- 'jumlah_kemaskini_kompaun' => $this->jumlah_kemaskini_kompaun,
- 'catatan_dari_admin' => $this->catatan_dari_admin,
- 'updated_by' => $this->updateby,
- 'amount_payment' => $this->amount_payment,
- 'created_at' => $this->created_at->format('Y-m-d H:i:s'),
- 'updated_at' => $this->updated_at->format('Y-m-d H:i'),
- ];
- }
- }
|