mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-28 15:09:40 -08:00
Re-added assetmodel import factory
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
3d3e3a9557
commit
3740b58580
|
@ -143,4 +143,25 @@ class ImportFactory extends Factory
|
|||
return $attributes;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create an asset model import type.
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function assetmodel()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
$fileBuilder = Importing\AssetModelsImportFileBuilder::new();
|
||||
|
||||
$attributes['name'] = "{$attributes['name']} Asset Model";
|
||||
$attributes['import_type'] = 'assetmodel';
|
||||
$attributes['header_row'] = $fileBuilder->toCsv()[0];
|
||||
$attributes['first_row'] = $fileBuilder->firstRow();
|
||||
|
||||
return $attributes;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue