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