fix: 修正 AdminUserSeeder 欄位結構與資料庫一致
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Database\Seeders;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
/**
|
||||
* 管理員帳號 Seeder
|
||||
@@ -21,7 +22,13 @@ class AdminUserSeeder extends Seeder
|
||||
$admin = User::where('username', 'admin')->first();
|
||||
|
||||
if ($admin) {
|
||||
$this->command->info('Admin 帳號已存在,跳過建立。');
|
||||
$this->command->info('Admin 帳號已存在,執行更新密碼與資料。');
|
||||
$admin->update([
|
||||
'name' => 'Admin',
|
||||
'email' => 'admin@star-cloud.com',
|
||||
'password' => Hash::make('password'),
|
||||
'role' => 'admin',
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -29,7 +36,7 @@ class AdminUserSeeder extends Seeder
|
||||
'username' => 'admin',
|
||||
'name' => 'Admin',
|
||||
'email' => 'admin@star-cloud.com',
|
||||
'password' => bcrypt('password'),
|
||||
'password' => Hash::make('password'),
|
||||
'role' => 'admin',
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user