feat(api): add portal_events to auth/me endpoint

Add persons() relationship to User model and include portal_events
array in MeResource response, mapping each person record to its
event and organisation data for the portal frontend.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 07:38:59 +02:00
parent 34eb790b3e
commit 7228ad9f5a
4 changed files with 187 additions and 1 deletions

View File

@@ -80,6 +80,11 @@ final class User extends Authenticatable
return $this->hasMany(PersonIdentityMatch::class, 'matched_user_id');
}
public function persons(): HasMany
{
return $this->hasMany(Person::class, 'user_id');
}
public function organisationTags(): HasMany
{
return $this->hasMany(UserOrganisationTag::class);