2017-10-29 09:19:02 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use App\Models\User;
|
2019-02-27 23:44:50 +08:00
|
|
|
use Illuminate\Support\Str;
|
2017-10-29 09:19:02 +08:00
|
|
|
|
|
|
|
$factory->define(User::class, function (Faker\Generator $faker) {
|
|
|
|
return [
|
|
|
|
'email' => $faker->email,
|
|
|
|
'nickname' => $faker->name,
|
|
|
|
'score' => 1000,
|
|
|
|
'avatar' => 0,
|
2019-02-27 23:44:50 +08:00
|
|
|
'password' => app('cipher')->hash(Str::random(10), config('secure.salt')),
|
2017-10-29 09:19:02 +08:00
|
|
|
'ip' => '127.0.0.1',
|
|
|
|
'permission' => 0,
|
2018-08-17 12:32:44 +08:00
|
|
|
'verified' => true,
|
2018-07-20 14:42:43 +08:00
|
|
|
'last_sign_at' => $faker->dateTime->format('d-M-Y H:i:s'),
|
2019-03-02 22:58:37 +08:00
|
|
|
'register_at' => $faker->dateTime->format('d-M-Y H:i:s'),
|
2017-10-29 09:19:02 +08:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
$factory->defineAs(User::class, 'admin', function (Faker\Generator $faker) {
|
|
|
|
return [
|
|
|
|
'email' => $faker->email,
|
|
|
|
'nickname' => $faker->name,
|
|
|
|
'score' => 1000,
|
|
|
|
'avatar' => 0,
|
2019-02-27 23:44:50 +08:00
|
|
|
'password' => app('cipher')->hash(Str::random(10), config('secure.salt')),
|
2017-10-29 09:19:02 +08:00
|
|
|
'ip' => '127.0.0.1',
|
|
|
|
'permission' => 1,
|
2018-08-17 12:32:44 +08:00
|
|
|
'verified' => true,
|
2018-07-20 14:42:43 +08:00
|
|
|
'last_sign_at' => $faker->dateTime->format('d-M-Y H:i:s'),
|
2019-03-02 22:58:37 +08:00
|
|
|
'register_at' => $faker->dateTime->format('d-M-Y H:i:s'),
|
2017-10-29 09:19:02 +08:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
$factory->defineAs(User::class, 'superAdmin', function (Faker\Generator $faker) {
|
|
|
|
return [
|
|
|
|
'email' => $faker->email,
|
|
|
|
'nickname' => $faker->name,
|
|
|
|
'score' => 1000,
|
|
|
|
'avatar' => 0,
|
2019-02-27 23:44:50 +08:00
|
|
|
'password' => app('cipher')->hash(Str::random(10), config('secure.salt')),
|
2017-10-29 09:19:02 +08:00
|
|
|
'ip' => '127.0.0.1',
|
|
|
|
'permission' => 2,
|
2018-08-17 12:32:44 +08:00
|
|
|
'verified' => true,
|
2018-07-20 14:42:43 +08:00
|
|
|
'last_sign_at' => $faker->dateTime->format('d-M-Y H:i:s'),
|
2019-03-02 22:58:37 +08:00
|
|
|
'register_at' => $faker->dateTime->format('d-M-Y H:i:s'),
|
2017-10-29 09:19:02 +08:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
$factory->defineAs(User::class, 'banned', function (Faker\Generator $faker) {
|
|
|
|
return [
|
|
|
|
'email' => $faker->email,
|
|
|
|
'nickname' => $faker->name,
|
|
|
|
'score' => 1000,
|
|
|
|
'avatar' => 0,
|
2019-02-27 23:44:50 +08:00
|
|
|
'password' => app('cipher')->hash(Str::random(10), config('secure.salt')),
|
2017-10-29 09:19:02 +08:00
|
|
|
'ip' => '127.0.0.1',
|
|
|
|
'permission' => -1,
|
2018-08-17 12:32:44 +08:00
|
|
|
'verified' => true,
|
2018-07-20 14:42:43 +08:00
|
|
|
'last_sign_at' => $faker->dateTime->format('d-M-Y H:i:s'),
|
2019-03-02 22:58:37 +08:00
|
|
|
'register_at' => $faker->dateTime->format('d-M-Y H:i:s'),
|
2017-10-29 09:19:02 +08:00
|
|
|
];
|
|
|
|
});
|