Fixed: Create admin
This commit is contained in:
parent
17c816ac50
commit
00029f75d5
@ -32,13 +32,11 @@ public static function boot()
|
||||
parent::boot();
|
||||
self::creating(function ($admin) {
|
||||
|
||||
if (app()->environment('production')) {
|
||||
// if not set api_token
|
||||
if (!$admin->api_token) {
|
||||
$admin->api_token = Str::random(60);
|
||||
} else {
|
||||
$admin->api_token = 123456;
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public function up()
|
||||
$admin->name = 'admin';
|
||||
$admin->email = 'admin@admin.test';
|
||||
$admin->password = bcrypt('admin');
|
||||
$admin->api_token = 'Qwerty123';
|
||||
$admin->api_token = 123456;
|
||||
$admin->save();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user