start project
This commit is contained in:
20
database/factories/CategoryFactory.php
Normal file
20
database/factories/CategoryFactory.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user