diff --git a/app/Abstracts/Export.php b/app/Abstracts/Export.php index 5ad500d08a8..068d3c2f35d 100644 --- a/app/Abstracts/Export.php +++ b/app/Abstracts/Export.php @@ -55,6 +55,11 @@ public function map($model): array foreach ($this->fields as $field) { $value = $model->$field; + // created_by is equal to the owner id. Therefore, the value in export is owner email. + if ($field == 'created_by') { + $value = $model->owner->email ?? null; + } + if (in_array($field, $date_fields)) { $value = ExcelDate::PHPToExcel(Date::parse($value)->format('Y-m-d')); }