From 8ddbb4e64f82201a118d0e8e58e5660d23198f43 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 2 Jun 2025 02:54:21 +0100 Subject: [PATCH] Added manufacturer factory Signed-off-by: snipe --- database/factories/ImportFactory.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/database/factories/ImportFactory.php b/database/factories/ImportFactory.php index f0b0bc0da4..95c9645524 100644 --- a/database/factories/ImportFactory.php +++ b/database/factories/ImportFactory.php @@ -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; + }); + } + }