'boolean', 'photo_permission' => 'boolean', ]; } public function getFullNameAttribute(): string { return "{$this->first_name} {$this->last_name}"; } public function team(): BelongsTo { return $this->belongsTo(Team::class); } public function parents(): BelongsToMany { return $this->belongsToMany(User::class, 'parent_player', 'player_id', 'parent_id') ->withPivot('relationship_label', 'created_at'); } public function participations(): HasMany { return $this->hasMany(EventParticipant::class); } public function scopeActive($query) { return $query->where('is_active', true); } public function getAvatarUrl(): ?string { if ($this->profile_picture) { return asset('storage/' . $this->profile_picture); } return null; } public function getInitials(): string { return mb_strtoupper(mb_substr($this->first_name, 0, 1) . mb_substr($this->last_name, 0, 1)); } public function isRestorable(): bool { return $this->trashed() && $this->deleted_at->diffInDays(now()) < 7; } }