meetup = $meetup; // Basic Information $this->name = $meetup->name ?? ''; $this->city_id = $meetup->city_id; $this->slug = $meetup->slug ?? ''; $this->intro = $meetup->intro; // Links and Social Media $this->telegram_link = $meetup->telegram_link; $this->webpage = $meetup->webpage; $this->twitter_username = $meetup->twitter_username; $this->matrix_group = $meetup->matrix_group; $this->nostr = $meetup->nostr; $this->nostr_status = $meetup->nostr_status; $this->simplex = $meetup->simplex; $this->signal = $meetup->signal; // Additional Information $this->community = $meetup->community; $this->github_data = $meetup->github_data ? json_encode($meetup->github_data, JSON_PRETTY_PRINT) : null; $this->visible_on_map = (bool) $meetup->visible_on_map; // System fields $this->created_by = $meetup->created_by; $this->created_at = $meetup->created_at?->format('Y-m-d H:i:s'); $this->updated_at = $meetup->updated_at?->format('Y-m-d H:i:s'); } public function updateMeetup(): void { $validated = $this->validate([ 'name' => ['required', 'string', 'max:255', Rule::unique('meetups')->ignore($this->meetup->id)], 'city_id' => ['nullable', 'exists:cities,id'], 'intro' => ['nullable', 'string'], 'telegram_link' => ['nullable', 'url', 'max:255'], 'webpage' => ['nullable', 'url', 'max:255'], 'twitter_username' => ['nullable', 'string', 'max:255'], 'matrix_group' => ['nullable', 'string', 'max:255'], 'nostr' => ['nullable', 'string', 'max:255'], 'simplex' => ['nullable', 'string', 'max:255'], 'signal' => ['nullable', 'string', 'max:255'], 'community' => ['nullable', 'string', 'max:255'], ]); // Convert github_data string back to array if provided if (!empty($validated['github_data'])) { $decoded = json_decode($validated['github_data'], true); if (json_last_error() === JSON_ERROR_NONE) { $validated['github_data'] = $decoded; } else { $validated['github_data'] = null; } } else { $validated['github_data'] = null; } $this->meetup->update($validated); $this->dispatch('meetup-updated', name: $this->meetup->name); session()->flash('status', __('Meetup erfolgreich aktualisiert!')); } public function with(): array { return [ 'cities' => City::orderBy('name')->get(), ]; } }; ?>