#3 telah kemaskini category

This commit is contained in:
pesu98
2026-05-12 10:41:18 +08:00
parent 53be5221e9
commit e99bd19035
15 changed files with 668 additions and 25 deletions

View File

@@ -0,0 +1,30 @@
<?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
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
$name = fake()->unique()->words(2, true);
return [
'name' => Str::title($name),
'slug' => Str::slug($name),
'description' => fake()->sentence(),
'color' => fake()->hexColor(),
];
}
}