2025-12-09 11:29:10 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Database\Factories;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
2026-01-22 15:30:47 +01:00
|
|
|
use Illuminate\Support\Str;
|
2025-12-09 11:29:10 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\DocumentCategory>
|
|
|
|
|
*/
|
|
|
|
|
class DocumentCategoryFactory extends Factory
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Define the model's default state.
|
|
|
|
|
*
|
|
|
|
|
* @return array<string, mixed>
|
|
|
|
|
*/
|
|
|
|
|
public function definition(): array
|
|
|
|
|
{
|
2026-01-22 15:30:47 +01:00
|
|
|
$name = $this->faker->unique()->word();
|
|
|
|
|
$slug = Str::slug($name);
|
|
|
|
|
|
2025-12-09 11:29:10 +01:00
|
|
|
return [
|
2026-01-22 15:30:47 +01:00
|
|
|
'name' => $name,
|
|
|
|
|
'slug' => $slug,
|
2025-12-09 11:29:10 +01:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|