'boolean', 'sort_order' => 'integer', ]; /** * 테넌트 관계 */ public function tenant(): BelongsTo { return $this->belongsTo(Tenant::class); } /** * 테넌트별 활성 계정과목 조회 */ public static function getActiveByTenant(int $tenantId) { return self::where('tenant_id', $tenantId) ->where('is_active', true) ->orderBy('sort_order') ->orderBy('code') ->get(); } }