<?php

namespace Database\Factories;

use App\Models\TextBlock;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

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

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'header' => $this->faker->sentence($this->faker->numberBetween(1, 5)),
            'body' => $this->faker->paragraph,
            'side_text' => $this->faker->paragraph,
            'style' => 'gray',
            'full_width' => 0,
            'number' => $this->faker->numberBetween(1,100),
        ];
    }

    public function stat()
    {
        return $this->state(function (array $attributes) {
            return [
                'title' => $this->faker->randomNumber(2),
                'subtitle' => $this->faker->word,
            ];
        });
    }

    public function search()
    {
        return $this->state(function (array $attributes) {
            return [
                'header' => $this->faker->sentence(),
                'body' => $this->faker->paragraph(),
            ];
        });
    }
}
