fix(NextCloud members and script - part 1)

This commit is contained in:
2026-01-19 15:31:34 +01:00
parent 08d1944491
commit b8de637b23
8 changed files with 287 additions and 29 deletions

View File

@@ -109,6 +109,12 @@ class Member extends Model
return "{$this->firstname} {$this->lastname}";
}
public function getRetzienEmailAttribute(): string
{
$emails = explode(';', $this->email);
return collect($emails)->filter(fn($email) => str_contains($email, '@retzien.fr'))->first();
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
@@ -142,4 +148,9 @@ class Member extends Model
->where('type', IspconfigType::WEB)
->first();
}
public function nextcloudAccounts(): HasMany
{
return $this->hasMany(NextCloudMember::class, 'member_id');
}
}