false, 'currentPubkey' => null, 'currentPleb' => null, ]); usesFileUploads(); on([ 'nostrLoggedIn' => function ($pubkey) { $this->currentPubkey = $pubkey; $this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $pubkey)->first(); if ($this->currentPleb->association_status->value < 3) { return $this->js('alert("Du bist hierzu nicht berechtigt.")'); } $this->isAllowed = true; }, 'nostrLoggedOut' => function () { $this->isAllowed = false; $this->currentPubkey = null; $this->currentPleb = null; }, ]); $save = function () { $this->form->validate(); $this->validate('image', 'image|max:1024'); $projectProposal = \App\Models\ProjectProposal::query()->create([ ...$this->form->all(), 'einundzwanzig_pleb_id' => $this->currentPleb->id, ]); if ($this->image) { $this->validate([ 'image' => 'image|max:1024', ]); $projectProposal ->addMedia($this->image->getRealPath()) ->toMediaCollection('main'); } return redirect()->route('association.projectSupport'); }; ?> @volt
@if ($image && method_exists($image, 'temporaryUrl') && str($image->getMimeType())->contains(['image/jpeg','image/jpg', 'image/png', 'image/gif', 'image/svg+xml', 'image/webp']))
{{ __('Preview') }}:
@endif @if (isset($projectProposal) && $projectProposal->getFirstMediaUrl('main'))
{{ __('Current picture') }}:
@endif
@error('image') {{ $message }} @enderror
{{ __('Beschreibung') }}
{{ __('Bitte verfasse einen ausführlichen und verständlichen Antragstext, damit die Abstimmung über eine mögliche Förderung erfolgen kann.') }}
{{ __('Für Bilder in Markdown verwende bitte z.B. Imgur oder einen anderen Anbieter.') }}
@error('form.description') {{ $message }} @enderror
{{ __('Zurück') }} {{ __('Save') }}
@endvolt