wip(Member & memberships sections)
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 1m29s
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 1m29s
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ class User extends Authenticatable
|
||||
|
||||
public static function getAttributeLabel(string $attribute): string
|
||||
{
|
||||
return __("users.fields.' . $attribute");
|
||||
return __("users.fields.$attribute");
|
||||
}
|
||||
|
||||
/*public static function getRoleLabel(string $role): string
|
||||
|
||||
Reference in New Issue
Block a user