UserFactory.php 866 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of the Jiannei/lumen-api-starter.
  4. *
  5. * (c) Jiannei <longjian.huang@foxmail.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace Database\Factories;
  11. use App\Repositories\Models\User;
  12. use Illuminate\Database\Eloquent\Factories\Factory;
  13. use Illuminate\Support\Facades\Hash;
  14. class UserFactory extends Factory
  15. {
  16. /**
  17. * The name of the factory's corresponding model.
  18. *
  19. * @var string
  20. */
  21. protected $model = User::class;
  22. /**
  23. * Define the model's default state.
  24. *
  25. * @return array
  26. */
  27. public function definition()
  28. {
  29. return [
  30. 'name' => $this->faker->name,
  31. 'email' => $this->faker->unique()->safeEmail,
  32. 'password' => Hash::make('password'),
  33. ];
  34. }
  35. }