27 lines
571 B
PHP
27 lines
571 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Article;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Comment>
|
|
*/
|
|
class CommentFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'article_id' => Article::factory(),
|
|
'author_name' => $this->faker->name,
|
|
'content' => $this->faker->sentence,
|
|
];
|
|
}
|
|
}
|