Added manufacturer factory

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2025-06-02 02:54:21 +01:00
parent cc40c48aac
commit 8ddbb4e64f
+18
View File
@@ -201,4 +201,22 @@ class ImportFactory extends Factory
});
}
/**
* Create a supplier import type.
*
* @return static
*/
public function manufacturers()
{
return $this->state(function (array $attributes) {
$fileBuilder = Importing\ManufacturersImportFileBuilder::new();
$attributes['name'] = "Manufacturer {$attributes['name']}";
$attributes['import_type'] = 'manufacturer';
$attributes['header_row'] = $fileBuilder->toCsv()[0];
$attributes['first_row'] = $fileBuilder->firstRow();
return $attributes;
});
}
}