Added created_by field value
This commit is contained in:
parent
e4c50704e5
commit
d9bca73382
@ -55,6 +55,11 @@ abstract class Export implements FromCollection, HasLocalePreference, ShouldAuto
|
||||
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'));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user