| 123456789101112131415161718192021222324252627 |
- <?php
- namespace Database\Factories;
- use Illuminate\Database\Eloquent\Factories\Factory;
- use App\Models\User;
- use App\Models\Blog;
- /**
- * @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()
- {
- return [
- 'authorId' => $this->faker->randomElement(User::query()->get('id')),
- 'comment' => $this->faker->realText($maxNbChars = 200, $indexSize = 2),
- 'blogId' => $this->faker->randomElement(Blog::query()->get('id')),
- ];
- }
- }
|