added created_by field to import
This commit is contained in:
parent
d9bca73382
commit
c9f0649a5b
@ -39,7 +39,12 @@ abstract class Import implements HasLocalePreference, ShouldQueue, SkipsEmptyRow
|
|||||||
public function map($row): array
|
public function map($row): array
|
||||||
{
|
{
|
||||||
$row['company_id'] = company_id();
|
$row['company_id'] = company_id();
|
||||||
$row['created_by'] = $this->user->id;
|
|
||||||
|
// created_by is equal to the owner id. Therefore, the value in export is owner email.
|
||||||
|
if (isset($row['created_by'])) {
|
||||||
|
$row['created_by'] = User::where('email', $row['created_by'])->first()?->id ?? $this->user->id;
|
||||||
|
}
|
||||||
|
|
||||||
$row['created_from'] = $this->getSourcePrefix() . 'import';
|
$row['created_from'] = $this->getSourcePrefix() . 'import';
|
||||||
|
|
||||||
// Make enabled field integer
|
// Make enabled field integer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user