php artisan make:model models\mymodels
php artisan make:factory myFactory
$factory->define(\App\models\mymodelsr::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
});
- 建立自己seed内容(生成文件在database/seeds)
php artisan make:seed mySeed
public function run()
{
// $this->call(UsersTableSeeder::class);
factory(\App\models\mymodelsr::class,10)->create();
}
// 宽限时间需要开启黑名单(默认是开启的),黑名单保证过期token不可再用,最好打开
'blacklist_enabled' => env('JWT_BLACKLIST_ENABLED', true)
// 设定宽限时间,单位:秒
'blacklist_grace_period' => env('JWT_BLACKLIST_GRACE_PERIOD', 60)