*/ class UploadableFactory extends Factory { protected $model = Uploadable::class; /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'uploadable_id' => $this->faker->numberBetween(1, 100), // شناسه‌ی تصادفی برای uploadable 'uploadable_type' => $this->faker->word, // نوع تصادفی uploadable 'gallery_id' => Gallery::factory(), // شناسه‌ی تصادفی برای gallery (در صورتی که گالری‌ها وجود داشته باشند) 'image_role' => $this->faker->word, // نقش تصادفی برای تصویر (مثل 'thumbnail' یا 'featured') ]; } }