Wohnungsumschalter im Verwaltungsmenue und wohnungsbezogene Listen

Oben im Seitenmenue waehlt man die Wohnung; Listen, neue Eintraege, Belegungsplan
und Preise & Angebote folgen ihr. Ein geoeffneter Eintrag einer anderen Wohnung
schaltet auf diese um. Galerie und Ersatz-Titelbild der Website zeigen nur Fotos
der Wohnung des Bausteins und Fotos ohne Wohnung.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-10-29 18:40:13 +01:00
1 parent e74033a958
commit 8bcda9a4bc
37 files changed
+520 -35

No files matched your search

+14
View File
@@ -81,6 +81,20 @@ protected function published(Builder $query): Builder
return $query->where('is_published', true)->orderBy('sort_order');
}
/**
* Photos of the apartment and those without an apartment (e.g. the area); without an apartment all photos.
*
* @param Builder<Photo> $query
* @return Builder<Photo>
*/
#[Scope]
protected function forProperty(Builder $query, ?Property $property): Builder
{
return $property === null
? $query
: $query->where(fn (Builder $query) => $query->where('property_id', $property->id)->orWhereNull('property_id'));
}
public function url(string $size = 'md'): string
{
return $this->getFirstMediaUrl(self::COLLECTION, $size);