UserFactory.php 804 B

12345678910111213141516171819202122232425
  1. <?php
  2. use Illuminate\Support\Str;
  3. use Faker\Generator as Faker;
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Model Factories
  7. |--------------------------------------------------------------------------
  8. |
  9. | This directory should contain each of the model factory definitions for
  10. | your application. Factories provide a convenient way to generate new
  11. | model instances for testing / seeding your application's database.
  12. |
  13. */
  14. $factory->define(App\User::class, function (Faker $faker) {
  15. return [
  16. 'name' => $faker->name,
  17. 'email' => $faker->unique()->safeEmail,
  18. 'email_verified_at' => now(),
  19. 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
  20. 'remember_token' => Str::random(10),
  21. ];
  22. });