All ~96 models grouped by domain namespace. Each model maps to one database table from
the schema changes document. Table names follow Laravel's
snake_case plural convention. Models are namespaced under App\Models\{Domain}\.
Core Patterns Applied Across Models
Tenant scoping: All firm-scoped models apply TenantScope global scope automatically.
Append-only: Financial models register AppendOnlyObserver in their booted() method.
INSERT is allowed, UPDATE and DELETE throw AppendOnlyViolationException.
Soft deletes: Seven models use Laravel's SoftDeletes trait (see
schema changes §5).
App\Models\Auth
| Model | Table | Notes |
|---|
User | users | Laravel Authenticatable. Has many FirmUserProfile, ClientUser, PartnerAttorneyUser. |
App\Models\Firm
| Model | Table | Notes |
|---|
LawFirm | law_firms | Implements HasTenants. Tenant anchor. |
FirmUserProfile | firm_user_profiles | BelongsTo User, BelongsTo LawFirm. SoftDeletes. |
LawyerLicense | lawyer_licenses | BelongsTo FirmUserProfile. |
OrgUnit | org_units | Self-referential parent/children. |
Position | positions | BelongsTo OrgUnit. |
CategoryDimension | category_dimensions | Lookup table. |
PositionCategory | position_categories | BelongsTo Position. |
UserPosition | user_positions | Pivot with started_at, ended_at. |
UserOrgUnit | user_org_units | Pivot. |
ReportingLine | reporting_lines | BelongsTo FirmUserProfile (manager + report). |
Specialty | specialties | Lookup table. |
FirmUserSpecialty | firm_user_specialties | Pivot. |
Locale | locales | Lookup table. |
UserProfileTranslation | user_profile_translations | BelongsTo FirmUserProfile. |
App\Models\Matter
| Model | Table | Notes |
|---|
Matter | matters | SoftDeletes. BelongsTo LawFirm. Global TenantScope. |
MatterBudget | matter_budgets | BelongsTo Matter. |
MatterAttorneyRoleType | matter_attorney_role_types | Lookup. |
MatterPartyRoleType | matter_party_role_types | Lookup. |
MatterFirmRoleType | matter_firm_role_types | Lookup. |
MatterAttorney | matter_attorneys | Pivot with role_type_id. |
MatterClient | matter_clients | Pivot with role_type_id. |
MatterPartnerAttorney | matter_partner_attorneys | Pivot. |
MatterPartnerFirm | matter_partner_firms | Pivot. |
MatterBillingSetting | matter_billing_settings | BelongsTo Matter. |
MatterRatePlanSelection | matter_rate_plan_selections | BelongsTo Matter. |
MatterPartnerRateSelection | matter_partner_rate_selections | BelongsTo Matter. |
App\Models\Client
| Model | Table | Notes |
|---|
Client | clients | SoftDeletes. BelongsTo LawFirm. |
ClientContact | client_contacts | BelongsTo Client. |
ClientUser | client_users | Links User to ClientContact. Portal auth record. |
ClientRatePlanSelection | client_rate_plan_selections | BelongsTo Client. |
App\Models\Partner
| Model | Table | Notes |
|---|
PartnerFirm | partner_firms | SoftDeletes. BelongsTo LawFirm. |
PartnerFirmContact | partner_firm_contacts | BelongsTo PartnerFirm. |
PartnerAttorney | partner_attorneys | SoftDeletes. BelongsTo PartnerFirm. |
PartnerAttorneyUser | partner_attorney_users | Links User to PartnerAttorney. Portal auth record. |
FirmPartnerRelationship | firm_partner_relationships | BelongsTo LawFirm, BelongsTo PartnerFirm. |
FirmPartnerAgreement | firm_partner_agreements | BelongsTo FirmPartnerRelationship. |
FirmPartnerRateCard | firm_partner_rate_cards | BelongsTo FirmPartnerRelationship. |
FirmPartnerJurisdiction | firm_partner_jurisdictions | BelongsTo FirmPartnerRelationship. |
App\Models\RBAC
| Model | Table | Notes |
|---|
Permission | permissions | System-defined. code is unique. |
Role | roles | HasMany RolePermission. |
RolePermission | role_permissions | Pivot with fields_mode, fields, condition_json. |
UserRoleAssignment | user_role_assignments | BelongsTo User, BelongsTo Role. Temporal (starts_at, ends_at). |
ResourceType | resource_types | Lookup. PK is code string. |
ResourceSubtype | resource_subtypes | BelongsTo ResourceType. |
ResourceAccessGrant | resource_access_grants | Polymorphic ACL. BelongsTo User. |
App\Models\Billing
| Model | Table | Notes |
|---|
BillingActivityCode | billing_activity_codes | Lookup. |
ExpenseCategory | expense_categories | Lookup. |
FirmTaxRate | firm_tax_rates | BelongsTo LawFirm. Temporal. |
LawyerRatePlan | lawyer_rate_plans | BelongsTo LawFirm. |
LawyerRatePlanRate | lawyer_rate_plan_rates | BelongsTo LawyerRatePlan. |
PartnerRatePlan | partner_rate_plans | BelongsTo LawFirm. |
PartnerRatePlanRate | partner_rate_plan_rates | BelongsTo PartnerRatePlan. |
LawyerTimeEntry | lawyer_time_entries | Append-only. BelongsTo Matter, BelongsTo FirmUserProfile. |
PartnerTimeEntry | partner_time_entries | Append-only. BelongsTo Matter. |
ExpenseEntry | expense_entries | Append-only. BelongsTo Matter. |
App\Models\Invoicing
| Model | Table | Notes |
|---|
Invoice | invoices | Append-only. BelongsTo Matter. |
InvoiceLineItem | invoice_line_items | Append-only. BelongsTo Invoice. |
CreditNote | credit_notes | BelongsTo Invoice. |
CreditNoteLine | credit_note_lines | BelongsTo CreditNote. |
CreditNoteAllocation | credit_note_allocations | BelongsTo CreditNote, BelongsTo Invoice. |
PaymentMethod | payment_methods | BelongsTo LawFirm. |
Payment | payments | Append-only. BelongsTo Invoice. |
PaymentAllocation | payment_allocations | BelongsTo Payment, BelongsTo Invoice. |
PaymentEvent | payment_events | Append-only. Event log for Payment. |
PartnerBill | partner_bills | BelongsTo PartnerFirm. |
PartnerBillLine | partner_bill_lines | BelongsTo PartnerBill. |
App\Models\ERP
| Model | Table | Notes |
|---|
ErpExportQueue | erp_export_queue | BelongsTo LawFirm. Pending ERP posting records. |
ErpAccountMapping | erp_account_mappings | BelongsTo LawFirm. |
ErpPostingRule | erp_posting_rules | BelongsTo LawFirm. |
Vendor | vendors | BelongsTo LawFirm. |
FirmOpex | firm_opex | BelongsTo LawFirm. |
App\Models\HR
| Model | Table | Notes |
|---|
PerformanceCycle | performance_cycles | BelongsTo LawFirm. |
PerformanceMetric | performance_metrics | BelongsTo PerformanceCycle. |
PerformanceReview | performance_reviews | BelongsTo FirmUserProfile. |
PerformanceReviewMetric | performance_review_metrics | Pivot. |
BonusPlan | bonus_plans | BelongsTo LawFirm. |
BonusAward | bonus_awards | BelongsTo BonusPlan, BelongsTo FirmUserProfile. |
BonusAwardRevision | bonus_award_revisions | Append-only revision history for BonusAward. |
App\Models\Content
| Model | Table | Notes |
|---|
Article | articles | BelongsTo LawFirm. Many-to-many Specialty. |
ArticleTranslation | article_translations | BelongsTo Article. |
App\Models\Appointment
| Model | Table | Notes |
|---|
Appointment | appointments | BelongsTo Matter. |
AppointmentAttendee | appointment_attendees | Pivot. |
AppointmentNote | appointment_notes | BelongsTo Appointment. |
AppointmentConsent | appointment_consents | BelongsTo Appointment. |
AppointmentEvent | appointment_events | Append-only. Status change log. |
Standalone Models
| Model | Table | Notes |
|---|
Document | documents | SoftDeletes. BelongsTo Matter. Uses Media Library. |
Comment | comments | Polymorphic commentable. |
SupportAccessSession | support_access_sessions | BelongsTo User (admin). |
AdminResourceLock | admin_resource_locks | Polymorphic lockable. |