*/ class PurchaseFactory extends Factory { protected $model = Purchase::class; /** * @return array */ public function definition(): array { return [ 'purchase_date' => $this->faker->dateTimeBetween('-1 month', 'now')->format('Y-m-d'), 'total' => 0, // Calculated later in seeder 'note' => $this->faker->optional()->sentence(), ]; } }