UserFactory.php 958 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /** @var \Illuminate\Database\Eloquent\Factory $factory */
  3. use App\User;
  4. use Illuminate\Support\Str;
  5. use Faker\Generator as Faker;
  6. /*
  7. |--------------------------------------------------------------------------
  8. | Model Factories
  9. |--------------------------------------------------------------------------
  10. |
  11. | This directory should contain each of the model factory definitions for
  12. | your application. Factories provide a convenient way to generate new
  13. | model instances for testing / seeding your application's database.
  14. |
  15. */
  16. $factory->define(User::class, function (Faker $faker) {
  17. $userNames=config('users.superAdmin');
  18. return [
  19. 'name' => $userNames[0],
  20. 'email' => $faker->unique()->safeEmail,
  21. 'email_verified_at' => now(),
  22. 'password' => '$2y$10$vvcID/Akq2KjOZwRUUgBJOpVyGi.nTDT8Yb7gxiy5Xj9/5GnpzBMi', // password
  23. //'api_token' => $faker->md5,
  24. 'remember_token' => Str::random(10),
  25. ];
  26. });