*/ class ProductFactory extends Factory { public function definition(): array { $slug = Str::slug($this->faker->unique()->words(3, true)); $categoryId = DB::table('product_categories')->insertGetId([ 'name' => 'Test Category ' . $this->faker->unique()->numberBetween(1, 9999), 'slug' => 'cat-' . $slug, 'type' => null, // null so boot() hook does not override product_type 'is_active' => true, 'sort_order' => 0, 'created_at' => now(), 'updated_at' => now(), ]); return [ 'product_categories_id' => $categoryId, 'product_type' => 'domain', 'name' => $this->faker->unique()->words(2, true), 'slug' => $slug, 'is_active' => true, 'is_unlimited' => true, 'setup_fee' => 0, 'trial_days' => 0, 'sort_order' => 0, ]; } }