'', 'description' => '', 'support_in_sats' => '', 'website' => '', 'accepted' => false, 'sats_paid' => 0, ]; public bool $isAllowed = false; public bool $isAdmin = false; public function mount($projectProposal): void { $this->project = ProjectProposal::query()->where('slug', $projectProposal)->firstOrFail(); if (NostrAuth::check()) { $currentPubkey = NostrAuth::pubkey(); $currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $currentPubkey)->first(); if ( ( $currentPleb && $currentPleb->id === $this->project->einundzwanzig_pleb_id ) || in_array($currentPleb->npub, config('einundzwanzig.config.current_board')) ) { $this->isAllowed = true; $this->form = [ 'name' => $this->project->name, 'description' => $this->project->description, 'support_in_sats' => (string) $this->project->support_in_sats, 'website' => $this->project->website ?? '', 'accepted' => (bool) $this->project->accepted, 'sats_paid' => $this->project->sats_paid, ]; } if ($currentPleb && in_array($currentPleb->npub, config('einundzwanzig.config.current_board'), true)) { $this->isAdmin = true; } } } public function update(): void { $this->validate([ 'form.name' => 'required|string|max:255', 'form.description' => 'required|string', 'form.support_in_sats' => 'required|integer|min:0', 'form.website' => 'required|url|max:255', ]); $this->project->update([ 'name' => $this->form['name'], 'description' => $this->form['description'], 'support_in_sats' => (int) $this->form['support_in_sats'], 'website' => $this->form['website'], 'accepted' => $this->isAdmin ? (bool) $this->form['accepted'] : $this->project->accepted, 'sats_paid' => $this->isAdmin ? $this->form['sats_paid'] : $this->project->sats_paid, ]); $this->redirectRoute('association.projectSupport.item', $this->project); } }; ?>
Bearbeite die Projektförderung und speichere deine Änderungen.
Um diese Projektförderung zu bearbeiten, musst du entweder:
@if(!NostrAuth::check()) Bitte melde dich zunächst mit Nostr an. @else Bitte kontaktiere den Vorstand, wenn du denkst, dass du berechtigt sein solltest. @endif