You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1 KiB

2 years ago
  1. <?php
  2. namespace Database\Factories\Documents;
  3. use App\Documents\UserDocument;
  4. use Illuminate\Database\Eloquent\Factories\Factory;
  5. use Illuminate\Support\Str;
  6. /**
  7. * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
  8. */
  9. class UserDocumentFactory extends Factory
  10. {
  11. protected $model = UserDocument::class;
  12. /**
  13. * Define the model's default state.
  14. *
  15. * @return array<string, mixed>
  16. */
  17. public function definition()
  18. {
  19. return [
  20. '_id' => app('nextId'),
  21. 'group_id' => 1,
  22. 'name' => fake()->name(),
  23. 'email' => fake()->safeEmail(),
  24. 'email_verified_at' => now(),
  25. 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
  26. 'remember_token' => Str::random(10),
  27. ];
  28. }
  29. /**
  30. * Indicate that the model's email address should be unverified.
  31. *
  32. * @return static
  33. */
  34. public function unverified()
  35. {
  36. return $this->state(function (array $attributes) {
  37. return [
  38. 'email_verified_at' => null,
  39. ];
  40. });
  41. }
  42. }