<?php

namespace Database\Factories;

use App\Models\Artist;
use App\Models\Artwork;
use App\Models\Episode;
use App\Models\Podcast;
use App\Models\Overlay;
use Illuminate\Database\Eloquent\Factories\Factory;
use Carbon\Carbon;
use Illuminate\Support\Str;

class EpisodeFactory extends Factory
{
    /**
     * The name of the factory's corresponding model
     * 
     * @var string
     */
    protected $model = Episode::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        $title = fake()->name();
        $slug = Str::slug($title);
        $created = fake()->dateTimeThisDecade();
        return [
            'podcast_id' => Podcast::factory(),
            'artwork_id' => Artwork::factory(),
            'published' => fake()->boolean(),
            'episode_date' => fake()->dateTimeThisDecade(),
            'slug' => $slug,
            'title' => $title,
            'mp3' => fake()->url(),
            'created_at' => $created,
            'updated_at' => $created,
            'legacy_id' => null,
        ];
    }
}