<?php

namespace Database\Factories;

use App\Models\News;
use App\Models\NewsTags;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\NewsTags>
 */
class NewsTagsFactory extends Factory
{
    protected $model = NewsTags::class;

    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        $tags = [
            'Berita',
            'Update',
            'Pengumuman',
            'Event',
            'Kegiatan',
            'Kominfo',
            'Diskominfo',
            'Pemerintah',
            'Publik',
            'Informasi',
            'Layanan',
            'Digital',
            'Teknologi',
            'Sosial',
            'Ekonomi',
            'Pendidikan',
            'Kesehatan',
            'Lingkungan',
            'Infrastruktur',
            'Transportasi',
        ];

        return [
            'news_id' => News::factory(),
            'name' => $this->faker->randomElement($tags),
        ];
    }

    /**
     * Indicate that the tag is for news category.
     */
    public function news(): static
    {
        return $this->state(fn (array $attributes) => [
            'name' => 'Berita',
        ]);
    }

    /**
     * Indicate that the tag is for announcement category.
     */
    public function announcement(): static
    {
        return $this->state(fn (array $attributes) => [
            'name' => 'Pengumuman',
        ]);
    }

    /**
     * Indicate that the tag is for event category.
     */
    public function event(): static
    {
        return $this->state(fn (array $attributes) => [
            'name' => 'Event',
        ]);
    }
}
