<?php

namespace Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;

class CourseDescriptionFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'header' => $this->faker->words(2, true).' '.$this->faker->numberBetween(8, 12),
            'body' => $this->faker->paragraph(),
            'credit' => $this->faker->sentence(),
        ];
    }

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