2015-05-08 08:42:04 -05:00
|
|
|
<?php
|
|
|
|
|
|
2017-04-11 10:41:19 -05:00
|
|
|
use App\User;
|
|
|
|
|
use Faker\Generator as Faker;
|
|
|
|
|
|
2015-05-08 08:42:04 -05:00
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Model Factories
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
2017-04-11 10:41:19 -05:00
|
|
|
| This directory should contain each of the model factory definitions for
|
|
|
|
|
| your application. Factories provide a convenient way to generate new
|
|
|
|
|
| model instances for testing / seeding your application's database.
|
2015-05-08 08:42:04 -05:00
|
|
|
|
|
|
|
|
|
*/
|
2016-10-07 16:39:42 -05:00
|
|
|
|
2017-04-11 15:43:42 +00:00
|
|
|
/* @var \Illuminate\Database\Eloquent\Factory $factory */
|
2017-04-11 10:41:19 -05:00
|
|
|
$factory->define(User::class, function (Faker $faker) {
|
2016-08-21 14:29:10 +02:00
|
|
|
static $password;
|
2016-08-21 14:23:50 +02:00
|
|
|
|
2015-05-08 08:42:04 -05:00
|
|
|
return [
|
|
|
|
|
'name' => $faker->name,
|
2016-09-20 08:23:40 +02:00
|
|
|
'email' => $faker->unique()->safeEmail,
|
2016-08-21 14:23:50 +02:00
|
|
|
'password' => $password ?: $password = bcrypt('secret'),
|
2015-05-08 08:42:04 -05:00
|
|
|
'remember_token' => str_random(10),
|
|
|
|
|
];
|
2015-05-09 16:43:43 -05:00
|
|
|
});
|