Added additional helper files to assetmodel importer

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2024-11-12 22:40:00 +00:00
parent 22c79d8e1b
commit 48713cbddf
9 changed files with 266 additions and 36 deletions
+19
View File
@@ -143,4 +143,23 @@ 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;
});
}
}