<?php

namespace Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\User;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Message>
 */
class MessageFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition()
    {
        return [
            'title' => $this->faker->realText($maxNbChars = 20, $indexSize = 2),
            'content' => $this->faker->realText($maxNbChars = 100, $indexSize = 2),
            'writer' => $this->faker->randomElement(User::query()->get('id')),
        ];
    }
}
