wip(Member & memberships sections)
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 1m29s

This commit is contained in:
2026-02-03 10:53:23 +01:00
parent e78f86d125
commit f39651748d
35 changed files with 1333 additions and 981 deletions

View File

@@ -139,22 +139,20 @@ class Member extends Model
return $this->hasMany(IspconfigMember::class, 'member_id');
}
public function ispconfigMail(): ?IspconfigMember
{
return $this->ispconfigs()
->where('type', IspconfigType::MAIL)
->first();
}
public function ispconfigsWeb(): ?IspconfigMember
{
return $this->ispconfigs()
->where('type', IspconfigType::WEB)
->first();
}
public function nextcloudAccounts(): HasMany
{
return $this->hasMany(NextCloudMember::class, 'member_id');
}
public function lastMembership(): Membership
{
return $this->memberships()->where('status', 'active')->first();
}
public function hasService(string $serviceIdentifier): bool
{
$membership = $this->lastMembership();
return $membership->services()->where('identifier', $serviceIdentifier)->exists();
}
}