UserFactory.php 816 B

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