UserFactory.php 917 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /** @var \Illuminate\Database\Eloquent\Factory $factory */
  3. use App\User;
  4. use Faker\Generator as Faker;
  5. use Illuminate\Support\Str;
  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. return [
  18. 'name' => $faker->name,
  19. 'email' => $faker->unique()->safeEmail,
  20. 'email_verified_at' => now(),
  21. 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
  22. 'remember_token' => Str::random(10),
  23. 'numLogin' => random_int(1,100),
  24. ];
  25. });