31 lines
666 B
PHP
31 lines
666 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Category;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
/**
|
|
* @extends Factory<Category>
|
|
*/
|
|
class CategoryFactory extends Factory
|
|
{
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
$label = fake()->unique()->words(2, true);
|
|
|
|
return [
|
|
'slug' => Str::slug($label),
|
|
'label' => ucfirst($label),
|
|
'desc' => fake()->paragraph(),
|
|
'image' => null,
|
|
'meta_title' => fake()->sentence(4),
|
|
'meta_description' => fake()->sentence(10),
|
|
];
|
|
}
|
|
}
|