faulty != null && $this->staffdetail != null){ return [ '_id' => $this->_id, 'modul' => $this->modul, 'jenis' => $this->jenis, 'kpd' => $this->kpd, 'no_plate' => $this->no_plate, 'nric' => $this->identity, 'no_daftar_syarikat' => $this->no_daftar_syarikat, 'nama_syarikat' => $this->nama_syarikat, 'nama' => $this->nama, 'lesen' => $this->no_akaun_lesen, 'tarikh_masa' => $this->created_at->format('d/m/Y H:i:s A'), 'faulty_skter' => $this->faulty->sketr, 'faulty_name' => $this->faulty->nama, 'enforcer' => $this->staffdetail->no_badan.', '.$this->staffdetail->full_name, 'status' => $this->status, 'kadar_kompaun' => $this->jumlah_kemaskini_kompaun !== '' ? $this->jumlah_kemaskini_kompaun : $this->jumlah_asal_kompaun, 'catatan_dari_admin' => $this->catatan_dari_admin, 'updated_by' => $this->updateby, 'updates_by' => $this->update_by, 'tarikh_bayar' => $this->tarikh_bayar, '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'), ]; } } }