Ingen beskrivning

UserFactory.php 875B

123456789101112131415161718192021222324252627
  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. 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. ];
  24. });