MessageFactory.php 752 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Database\Factories;
  3. use App\Models\User;
  4. use Illuminate\Database\Eloquent\Factories\Factory;
  5. /**
  6. * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\message>
  7. */
  8. class MessageFactory extends Factory
  9. {
  10. /**
  11. * Define the model's default state.
  12. *
  13. * @return array<string, mixed>
  14. */
  15. public function definition()
  16. {
  17. return [
  18. 'title' => $this->faker->word(),
  19. 'content' => $this->faker->paragraph(),
  20. 'author_id' => $this->faker->randomElement(User::pluck('id')),
  21. 'preview'=> $this->faker->word(),
  22. 'tag' => $this->faker->word(),
  23. 'thumbnail' => $this->faker->imageUrl(800, 550, 'fake', true),
  24. ];
  25. }
  26. }