38 lines
821 B
PHP
38 lines
821 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Database\Factories;
|
||
|
|
|
||
|
|
use App\Models\Product;
|
||
|
|
use App\Models\ProductComment;
|
||
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @extends Factory<\App\Models\ProductComment>
|
||
|
|
*/
|
||
|
|
final class ProductCommentFactory extends Factory
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* The name of the factory's corresponding model.
|
||
|
|
*
|
||
|
|
* @var string
|
||
|
|
*/
|
||
|
|
protected $model = ProductComment::class;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Define the model's default state.
|
||
|
|
*
|
||
|
|
* @return array
|
||
|
|
*/
|
||
|
|
public function definition(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'product_id' => fake()->randomElement(Product::pluck('id')),
|
||
|
|
'evaluation' => fake()->word,
|
||
|
|
'aspect' => fake()->word,
|
||
|
|
'taste' => fake()->word,
|
||
|
|
'odor' => fake()->word,
|
||
|
|
'texture' => fake()->word,
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|