*/ class ProductFactory extends Factory { /** * The name of the factory's corresponding model. * * @var class-string */ protected $model = Product::class; /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'name' => fake()->text(30), 'description' => fake()->text(100), 'price' => fake()->randomFloat(2, 1, 300), 'stock' => fake()->numberBetween(0, 30), ]; } }