feat: 分離 AdminUserSeeder 並重構 DatabaseSeeder 支援單獨執行
All checks were successful
Star-Cloud-Deploy-System / deploy-demo (push) Successful in 39s
Star-Cloud-Deploy-System / deploy-production (push) Has been skipped

This commit is contained in:
2026-01-12 13:04:59 +08:00
parent a0d107ca79
commit 7db3ee3a05
2 changed files with 43 additions and 7 deletions

View File

@@ -9,16 +9,14 @@ class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* 執行全部 Seederphp artisan db:seed
* 執行單一 Seederphp artisan db:seed --class=AdminUserSeeder
*/
public function run(): void
{
// 建立管理員帳號
\App\Models\User::factory()->create([
'username' => 'admin',
'name' => 'Admin',
'email' => 'admin@star-cloud.com',
'password' => bcrypt('password'),
'role' => 'admin',
$this->call([
AdminUserSeeder::class,
]);
}
}