*/ class PackageFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'name' => $this->faker->word, 'note' => $this->faker->optional()->word, 'user_id' => User::factory(), // ایجاد کاربر به طور خودکار 'bar_code' => $this->faker->optional()->word, 'qr_code' => $this->faker->optional()->word, 'creator_id' => User::factory(), // ایجاد کاربر دیگر به عنوان creator 'status' => $this->faker->randomElement(['approved', 'rejected', 'pending']), 'created_at' => now(), 'updated_at' => now(), ]; } }