21 lines
437 B
PHP
21 lines
437 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
class CategoryFactory extends Factory
|
|
{
|
|
public function definition(): array
|
|
{
|
|
$name = fake()->unique()->words(2, true);
|
|
|
|
return [
|
|
'name' => Str::headline($name),
|
|
'slug' => Str::slug($name),
|
|
'description' => fake()->optional()->sentence(),
|
|
];
|
|
}
|
|
}
|