mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 20:21:05 +03:30
30 lines
999 B
PHP
Executable File
30 lines
999 B
PHP
Executable File
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Gallery;
|
|
use App\Models\Uploadable;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Model>
|
|
*/
|
|
class UploadableFactory extends Factory
|
|
{
|
|
protected $model = Uploadable::class;
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
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')
|
|
];
|
|
}
|
|
}
|