$this->id, 'company_id' => $this->company_id, 'class' => $this->class, 'name' => $this->name, 'description' => $this->description, 'settings' => $this->settings, 'data' => $this->getReportData(), 'created_from' => $this->created_from, 'created_by' => $this->created_by, 'created_at' => $this->created_at ? $this->created_at->toIso8601String() : '', 'updated_at' => $this->updated_at ? $this->updated_at->toIso8601String() : '', ]; } protected function getReportData() { if (! Utility::canShow($this->class)) { return []; } $report = Utility::getClassInstance($this); if (empty($report)) { return []; } $unset_attributes = ['model', 'views', 'loaded', 'column_name_width', 'column_value_width']; foreach ($unset_attributes as $attribute) { unset($report->$attribute); } return $report; } }