'boolean', 'gallery_media' => 'array', 'venue_types' => 'array', 'lat' => 'float', 'lng' => 'float', 'sort' => 'integer', 'live_people_count' => 'integer', ]; protected static function booted(): void { static::saving(function (Venue $v) { $types = $v->venue_types; if (is_array($types) && count($types)) { $clean = array_values(array_filter(array_map('strval', $types), fn ($s) => $s !== '')); $v->venue_types = $clean; $v->venue_type = $clean[0] ?? null; } elseif (! empty($v->venue_type)) { $v->venue_types = [$v->venue_type]; } else { $v->venue_type = null; $v->venue_types = null; } }); } public function activities(): HasMany { return $this->hasMany(Activity::class); } public function admins(): BelongsToMany { return $this->belongsToMany(User::class, 'user_venue')->withTimestamps(); } public function reservations(): HasMany { return $this->hasMany(Reservation::class); } }