<?php

namespace Database\Factories;

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

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

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'body' => $this->faker->paragraph,
            'author_name' => $this->faker->name,
            'author_details' => $this->faker->sentence,
            'flip' => $this->faker->boolean,
            'number' => $this->faker->numberBetween(1,100),
        ];
    }

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