ldc-startcoq/database/factories/ProductCommentFactory.php

38 lines
821 B
PHP
Raw Normal View History

2023-02-23 16:23:00 +01:00
<?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,
];
}
}