2023-06-21 09:53:21 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Database\Factories;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
2023-07-29 02:05:43 -04:00
|
|
|
use Illuminate\Support\Str;
|
|
|
|
use App\Models\Artist;
|
|
|
|
use App\Models\Artwork;
|
|
|
|
use App\Models\Episode;
|
|
|
|
use App\Models\Podcast;
|
|
|
|
use App\Models\Overlay;
|
2023-06-21 09:53:21 -04:00
|
|
|
|
|
|
|
class ArtworkFactory extends Factory
|
|
|
|
{
|
2023-07-29 02:05:43 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The name of the factory's corresponding model
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $model = Artwork::class;
|
|
|
|
|
2023-06-21 09:53:21 -04:00
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function definition()
|
|
|
|
{
|
2023-08-22 17:04:37 -04:00
|
|
|
$created = fake()->dateTimeThisDecade();
|
2023-06-21 09:53:21 -04:00
|
|
|
return [
|
2023-07-29 02:05:43 -04:00
|
|
|
'title' => fake()->name(),
|
2023-08-22 17:04:37 -04:00
|
|
|
'description' => rand(0, 1) ? fake()->paragraphs(rand(1, 3), true) : null,
|
2023-07-29 02:05:43 -04:00
|
|
|
'artist_id' => Artist::factory(),
|
|
|
|
'podcast_id' => Podcast::factory(),
|
|
|
|
'episode_id' => Episode::factory(),
|
|
|
|
'overlay_id' => rand(0, 1) ? Overlay::factory() : null,
|
|
|
|
'filename' => fake()->imageUrl(3000, 3000),
|
2023-08-22 17:04:37 -04:00
|
|
|
'created_at' => $created,
|
|
|
|
'updated_at' => $created,
|
|
|
|
'legacy_id' => null,
|
2023-06-21 09:53:21 -04:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|