finishes 13 and 14
This commit is contained in:
29
database/factories/CategoryFactory.php
Normal file
29
database/factories/CategoryFactory.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Category;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* Factory for generating Category test data.
|
||||
*
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Category>
|
||||
*/
|
||||
final class CategoryFactory extends Factory
|
||||
{
|
||||
protected $model = Category::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->unique()->words(2, true),
|
||||
'sort_order' => fake()->numberBetween(0, 10),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user