EmployeeModelFactory.php 822 B

123456789101112131415161718192021222324252627
  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. /** @var \Illuminate\Database\Eloquent\Factory $factory */
  13. use App\Shop\Employees\Employee;
  14. $factory->define(Employee::class, function (Faker\Generator $faker) {
  15. static $password;
  16. return [
  17. 'name' => $faker->firstName,
  18. 'email' => $faker->unique()->safeEmail,
  19. 'password' => $password ?: $password = bcrypt('secret'),
  20. 'remember_token' => str_random(10),
  21. 'status' => 1
  22. ];
  23. });