From 2c8fdd1d6f07ab5d757395e6a9e8ff4de3f6ec53 Mon Sep 17 00:00:00 2001 From: Sam Light Date: Sat, 18 Jan 2025 23:23:30 +0000 Subject: More testing setup --- workbench/database/factories/ProductFactory.php | 5 ++++- .../database/migrations/2025_01_18_201725_create_products_table.php | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'workbench/database') diff --git a/workbench/database/factories/ProductFactory.php b/workbench/database/factories/ProductFactory.php index 4131cb2..081e196 100644 --- a/workbench/database/factories/ProductFactory.php +++ b/workbench/database/factories/ProductFactory.php @@ -27,7 +27,10 @@ class ProductFactory extends Factory public function definition(): array { return [ - // + 'name' => fake()->text(30), + 'description' => fake()->text(100), + 'price' => fake()->randomFloat(2, 1, 300), + 'stock' => fake()->numberBetween(0, 30), ]; } } diff --git a/workbench/database/migrations/2025_01_18_201725_create_products_table.php b/workbench/database/migrations/2025_01_18_201725_create_products_table.php index 7ee7127..4396485 100644 --- a/workbench/database/migrations/2025_01_18_201725_create_products_table.php +++ b/workbench/database/migrations/2025_01_18_201725_create_products_table.php @@ -14,8 +14,9 @@ return new class extends Migration Schema::create('products', function (Blueprint $table) { $table->id(); $table->string('name'); - $table->string('descripton'); + $table->string('description'); $table->decimal('price', total: 8, places: 2); + $table->unsignedInteger('stock'); $table->timestamps(); $table->softDeletes(); }); -- cgit v1.2.3