28 lines
645 B
PHP
28 lines
645 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Product>
|
|
*/
|
|
class ProductFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'name' => $this->faker->word(),
|
|
'description' => $this->faker->sentence(),
|
|
'category_id' => \App\Models\Category::factory(),
|
|
'slug' => Str::slug($this->faker->word()),
|
|
];
|
|
}
|
|
}
|