validate([ 'newCityName' => ['required', 'string', 'max:255', 'unique:cities,name'], 'newCityCountryId' => ['required', 'exists:countries,id'], 'newCityLatitude' => ['required', 'numeric'], 'newCityLongitude' => ['required', 'numeric'], ]); $city = City::create([ 'name' => $validated['newCityName'], 'country_id' => $validated['newCityCountryId'], 'latitude' => $validated['newCityLatitude'], 'longitude' => $validated['newCityLongitude'], 'slug' => str($validated['newCityName'])->slug(), 'created_by' => auth()->id(), ]); $this->city_id = $city->id; $this->reset(['newCityName', 'newCityCountryId', 'newCityLatitude', 'newCityLongitude']); \Flux\Flux::modal('add-city')->close(); } public function mount(): void { $this->meetup->load('media'); // Basic Information $this->name = $this->meetup->name ?? ''; $this->city_id = $this->meetup->city_id; $this->slug = $this->meetup->slug ?? ''; $this->intro = $this->meetup->intro; // Links and Social Media $this->telegram_link = $this->meetup->telegram_link; $this->webpage = $this->meetup->webpage; $this->twitter_username = $this->meetup->twitter_username; $this->matrix_group = $this->meetup->matrix_group; $this->nostr = $this->meetup->nostr; $this->nostr_status = $this->meetup->nostr_status; $this->simplex = $this->meetup->simplex; $this->signal = $this->meetup->signal; // Additional Information $this->community = $this->meetup->community; $this->github_data = $this->meetup->github_data ? json_encode($this->meetup->github_data, JSON_PRETTY_PRINT) : null; $this->visible_on_map = (bool) $this->meetup->visible_on_map; // System fields $this->created_by = $this->meetup->created_by; $this->created_at = $this->meetup->created_at?->format('Y-m-d H:i:s'); $this->updated_at = $this->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' => ['required', '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); if ($this->logo) { $this->meetup->clearMediaCollection('logo'); $this->meetup ->addMedia($this->logo->getRealPath()) ->usingName($this->meetup->name) ->toMediaCollection('logo'); $this->logo = null; $this->meetup->load('media'); } $this->dispatch('meetup-updated', name: $this->meetup->name); session()->flash('status', __('Meetup erfolgreich aktualisiert!')); } public function with(): array { return [ 'cities' => City::query() ->with([ 'country', ]) ->orderBy('name') ->get(), 'countries' => Country::query()->orderBy('countries.name')->get(), ]; } }; ?>
{{ __('Meetup bearbeiten') }}: {{ $meetup->name }}
{{ __('Grundlegende Informationen') }}
@if (!$logo && $meetup->getFirstMedia('logo')) Logo @elseif($logo) Logo @else @endif
{{ __('ID') }} {{ __('System-generierte ID (nur lesbar)') }} {{ __('Name') }} * {{ __('Der Anzeigename für dieses Meetup') }}
{{ __('Stadt') }} {{ __('Stadt hinzufügen') }}
@foreach($cities as $city) {{ $city->name }} ({{ $city->country->name }}) @endforeach {{ __('Die nächstgrößte Stadt oder Ort') }}
{{ __('Einführung') }} {{ __('Kurze Beschreibung des Meetups') }}
{{ __('Links & Soziale Medien') }}
{{ __('Webseite') }} {{ __('Offizielle Webseite oder Landingpage') }} {{ __('Telegram Link') }} {{ __('Link zur Telegram-Gruppe oder zum Kanal') }}
{{ __('Twitter Benutzername') }} {{ __('Twitter-Handle ohne @ Symbol') }} {{ __('Matrix Gruppe') }} {{ __('Matrix-Raum Bezeichner oder Link') }}
{{ __('Nostr') }} {{ __('Nostr öffentlicher Schlüssel oder Bezeichner') }}
{{ __('SimpleX') }} {{ __('SimpleX Chat Kontaktinformationen') }} {{ __('Signal') }} {{ __('Signal Kontakt- oder Gruppeninformationen') }}
{{ __('Zusätzliche Informationen') }}
{{ __('Gemeinschaft') }} {{ __('Keine') }} {{ __('Einundzwanzig Community') }} {{ __('Allgemeine Bitcoin Community') }} {{ __('Gemeinschafts- oder Organisationsname') }}
{{ __('Systeminformationen') }}
{{ __('Erstellt von') }} {{ __('Ersteller des Meetups') }} {{ __('Erstellt am') }} {{ __('Wann dieses Meetup erstellt wurde') }} {{ __('Aktualisiert am') }} {{ __('Letzte Änderungszeit') }}
{{ __('Abbrechen') }}
@if (session('status')) {{ session('status') }} @endif {{ __('Meetup aktualisieren') }}
{{ __('Stadt hinzufügen') }} {{ __('Füge eine neue Stadt zur Datenbank hinzu.') }}
{{ __('Stadtname') }} * {{ __('Land') }} * @foreach($countries as $country)
{{ str($country->code)->lower() }} {{ $country->name }}
@endforeach
{{ __('Breitengrad') }} * {{ __('Längengrad') }} *
{{ __('Abbrechen') }} {{ __('Stadt erstellen') }}