2017-12-13 10:14:01 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Faker\Generator as Faker;
|
|
|
|
|
2017-12-13 11:50:55 +08:00
|
|
|
$factory->define(App\Models\User::class, function (Faker $faker)
|
|
|
|
{
|
2017-12-13 10:14:01 +08:00
|
|
|
static $password;
|
|
|
|
|
|
|
|
return [
|
2017-12-13 11:50:55 +08:00
|
|
|
'id' => $faker->unique()->numberBetween(10, 10000),
|
2017-12-13 10:14:01 +08:00
|
|
|
'name' => $faker->name,
|
|
|
|
'email' => $faker->safeEmail,
|
2017-12-13 11:50:55 +08:00
|
|
|
'password' => $password ?: $password = Hash::make('secret'),
|
2017-12-13 10:14:01 +08:00
|
|
|
'api_key' => $faker->sha1,
|
2017-12-14 00:56:26 +08:00
|
|
|
'airline_id' => 1,
|
|
|
|
'rank_id' => 1,
|
2017-12-13 10:14:01 +08:00
|
|
|
'flights' => $faker->numberBetween(0, 1000),
|
|
|
|
'flight_time' => $faker->numberBetween(0, 10000),
|
2017-12-13 11:50:55 +08:00
|
|
|
'remember_token' => $faker->unique()->text(5),
|
2017-12-13 10:14:01 +08:00
|
|
|
];
|
|
|
|
});
|