UserFactory.php 831 B

1234567891011121314151617181920212223242526
  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. 'role_id' => null,
  19. 'email_verified_at' => now(),
  20. 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
  21. 'remember_token' => Str::random(10),
  22. ];
  23. });