Added created by

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-11-13 18:21:27 +00:00
parent d7e5fe50eb
commit 54f7917fbe

View file

@ -51,6 +51,7 @@ class LocationImporter extends ItemImporter
} else { } else {
$this->log('No Matching Location, Create a new one'); $this->log('No Matching Location, Create a new one');
$location = new Location; $location = new Location;
$location->created_by = auth()->id();
} }
// Pull the records from the CSV to determine their values // Pull the records from the CSV to determine their values
@ -65,7 +66,6 @@ class LocationImporter extends ItemImporter
$this->item['ldap_ou'] = trim($this->findCsvMatch($row, 'ldap_ou')); $this->item['ldap_ou'] = trim($this->findCsvMatch($row, 'ldap_ou'));
$this->item['manager'] = trim($this->findCsvMatch($row, 'manager')); $this->item['manager'] = trim($this->findCsvMatch($row, 'manager'));
$this->item['manager_username'] = trim($this->findCsvMatch($row, 'manager_username')); $this->item['manager_username'] = trim($this->findCsvMatch($row, 'manager_username'));
$this->item['created_by'] = auth()->id();
if ($this->findCsvMatch($row, 'parent_location')) { if ($this->findCsvMatch($row, 'parent_location')) {
$this->item['parent_id'] = $this->createOrFetchLocation(trim($this->findCsvMatch($row, 'parent_location'))); $this->item['parent_id'] = $this->createOrFetchLocation(trim($this->findCsvMatch($row, 'parent_location')));