預設分類

This commit is contained in:
2026-02-02 13:16:06 +08:00
parent 75c634ffe4
commit df3db38dd4
2 changed files with 8 additions and 0 deletions

View File

@@ -13,6 +13,11 @@ class CategorySeeder extends Seeder
public function run(): void public function run(): void
{ {
$categories = [ $categories = [
[
'name' => '商品',
'description' => '由原物料加工完成的成品',
'is_active' => true,
],
[ [
'name' => '原物料', 'name' => '原物料',
'description' => '製作飲品或餐點的基礎原料', 'description' => '製作飲品或餐點的基礎原料',

View File

@@ -37,6 +37,9 @@ class TenantDatabaseSeeder extends Seeder
// 初始化基本單位資料 // 初始化基本單位資料
$this->call(UnitSeeder::class); $this->call(UnitSeeder::class);
// 初始化預設商品分類
$this->call(CategorySeeder::class);
// 確保 admin 擁有 super-admin 角色 // 確保 admin 擁有 super-admin 角色
if (!$admin->hasRole('super-admin')) { if (!$admin->hasRole('super-admin')) {
$admin->assignRole('super-admin'); $admin->assignRole('super-admin');