ModelFactory.php 692 B

1234567891011121314151617181920212223
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Model Factories
  5. |--------------------------------------------------------------------------
  6. |
  7. | Here you may define all of your model factories. Model factories give
  8. | you a convenient way to create models for testing and seeding your
  9. | database. Just tell the factory how a default model should look.
  10. |
  11. */
  12. $factory->define(App\User::class, function (Faker\Generator $faker) {
  13. static $password;
  14. return [
  15. 'name' => $faker->name,
  16. 'email' => $faker->safeEmail,
  17. 'password' => $password ?: $password = bcrypt('secret'),
  18. 'remember_token' => str_random(10),
  19. ];
  20. });