php-tenant/Concerns
Claude 275cba29d7
refactor: guard external relationships in User model with class_exists()
Moves all external module relationships (Page, Project, Domain, Pixel,
AnalyticsWebsite, AnalyticsGoal, PushWebsite, PushCampaign, PushSegment,
PushFlow, TrustCampaign, TrustNotification, Order) out of the User model
into dedicated opt-in traits that resolve model classes at runtime via
class_exists(). This prevents fatal errors when consuming apps do not
have those modules installed.

New traits:
- HasPageRelationships (pages, projects, domains, pixels, bio/sub-page entitlements)
- HasAnalyticsRelationships (analytics websites, goals)
- HasPushRelationships (push websites, campaigns, segments, flows)
- HasTrustRelationships (trust campaigns, notifications)
- HasOrderRelationships (orders, vanity URL entitlement)

The User model still uses all five traits so existing consumers see no
breaking changes — the relationships now return null instead of throwing
a class-not-found error when the backing module is absent.

Fixes #6

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 13:22:36 +00:00
..
BelongsToNamespace.php refactor: rename namespace from Core\Mod\Tenant to Core\Tenant 2026-01-27 16:30:46 +00:00
BelongsToWorkspace.php refactor: rename namespace from Core\Mod\Tenant to Core\Tenant 2026-01-27 16:30:46 +00:00
HasAnalyticsRelationships.php refactor: guard external relationships in User model with class_exists() 2026-03-24 13:22:36 +00:00
HasOrderRelationships.php refactor: guard external relationships in User model with class_exists() 2026-03-24 13:22:36 +00:00
HasPageRelationships.php refactor: guard external relationships in User model with class_exists() 2026-03-24 13:22:36 +00:00
HasPushRelationships.php refactor: guard external relationships in User model with class_exists() 2026-03-24 13:22:36 +00:00
HasTrustRelationships.php refactor: guard external relationships in User model with class_exists() 2026-03-24 13:22:36 +00:00
HasWorkspaceCache.php refactor: rename namespace from Core\Mod\Tenant to Core\Tenant 2026-01-27 16:30:46 +00:00
PreventsSSRF.php security: fix P1 items for rate limiting, auth, SSRF and workspace validation 2026-01-29 13:19:27 +00:00
TwoFactorAuthenticatable.php refactor: rename namespace from Core\Mod\Tenant to Core\Tenant 2026-01-27 16:30:46 +00:00