---
title: Label Bounded Context
type: entity
created: 2026-09-06
updated: 2026-09-06
sources: [raw/sessions/2026-09-06-frontend-integration.md]
tags: [label, context, issue-tracking]
---

# Label Bounded Context

`Label` is a workspace-level tag that can be attached to tickets (e.g. `Frontend`, `Priority`, `Enhancement`). It was added as part of the issue-tracking frontend port.

## Domain

- **Aggregate:** `Domain\Label\Entities\Label` (`src/Domain/Label/Entities/Label.php`) — `reconstitute(LabelId, name, color)`; getters `id()`, `name()`, `color()`.
- **Value object:** `LabelId` (string id).
- **Repository interface:** `LabelRepositoryInterface` — `nextIdentity()`, `save()`, `findById()`, `all()`, `delete(LabelId)`.

## Infrastructure

- `LabelModel` (table `label`, string PK `label_id`; `tickets()` BelongsToMany via `label_ticket`).
- `LabelMapper`, `EloquentLabelRepository`.

## Persistence / relationships

`label` and the `label_ticket` pivot were created by `2026_09_06_000000_extend_for_issue_tracking.php`. A ticket's labels are stored as a BelongsToMany pivot; the ticket aggregate exposes them as `list<LabelId>` and the repository syncs the pivot on save.

## Application / presentation

- Query: `ListLabels`. Commands: `CreateLabel`, `DeleteLabel`.
- Presentation: `LabelController` (`/w/{workspace}/labels`).

## Related pages

- [ticket](ticket.md) — labels are attached to tickets
- [workspace](workspace.md) — labels are workspace-scoped
- [overview](../overview.md) — project context