UserFactory.php 824 B

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