29 lines
560 B
PHP
29 lines
560 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Category;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<Category>
|
|
*/
|
|
class CategoryFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
$name = str()->limit($this->faker->sentence, 40);
|
|
|
|
return [
|
|
'name' => $name,
|
|
'slug' => str()->slug($name),
|
|
'is_active' => $this->faker->boolean(80),
|
|
];
|
|
}
|
|
}
|