- ui_elements/ui_bundles/ui_bundle_items 三表 + Models(TenantScoped) - config/ui_parts.php 部位定義(Phase 1 啟用 A1/A2/A3 滿版) - UiElementController 三頁 CRUD + 圖片上傳(ImageHandler storeAsWebp) - 機台綁定存 machines.settings['ui_bundle_id'] - B014 getSettings 新增 UISet(部位→絕對圖URL,mirror B005) - 解除 sidebar APP管理 註解 + can:menu.app + 權限白名單 - zh_TW/en 翻譯 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
34 lines
654 B
PHP
34 lines
654 B
PHP
<?php
|
|
|
|
namespace App\Models\System;
|
|
|
|
use App\Traits\TenantScoped;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class UiBundle extends Model
|
|
{
|
|
use HasFactory, TenantScoped;
|
|
|
|
protected $fillable = [
|
|
'company_id',
|
|
'name',
|
|
];
|
|
|
|
/**
|
|
* 組合內容:各部位 → 元素/色值。
|
|
*/
|
|
public function items()
|
|
{
|
|
return $this->hasMany(UiBundleItem::class);
|
|
}
|
|
|
|
/**
|
|
* 以 part_key 為鍵的內容對照(方便下發與表單回填)。
|
|
*/
|
|
public function itemsByPart()
|
|
{
|
|
return $this->items->keyBy('part_key');
|
|
}
|
|
}
|