{{ $post->name }}
{{ $post->description }}
'', 'name' => '', 'description' => '', ]; public mixed $file; public bool $isAllowed = false; public bool $canEdit = false; public function mount(): void { if (NostrAuth::check()) { $currentPubkey = NostrAuth::pubkey(); $currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $currentPubkey)->first(); if ($currentPleb && $currentPleb->association_status->value > 1 && $currentPleb->paymentEvents()->where('year', date('Y'))->where('paid', true)->exists()) { $this->isAllowed = true; } if ($currentPleb && $currentPleb->association_status->value > 2) { $this->canEdit = true; } $this->news = \App\Models\Notification::query() ->with(['einundzwanzigPleb.profile']) ->latest() ->get(); } } public function save(): void { $this->validate([ 'file' => 'required|file|mimes:pdf', 'form.category' => 'required|string|in:'.implode(',', NewsCategory::values()), 'form.name' => 'required|string|max:255', 'form.description' => 'nullable|string', ]); $currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', NostrAuth::pubkey())->first(); $news = Notification::query()->create([ 'name' => $this->form['name'], 'description' => $this->form['description'] ?? null, 'category' => $this->form['category'], 'einundzwanzig_pleb_id' => $currentPleb->id, ]); if ($this->file) { $news ->addMedia($this->file) ->toMediaCollection('pdf'); } $this->reset(['form', 'file']); $this->news = \App\Models\Notification::query() ->with(['einundzwanzigPleb.profile']) ->latest() ->get(); } public function delete(int $id): void { $news = Notification::query()->find($id); if ($news) { $news->delete(); } $this->news = \App\Models\Notification::query() ->with(['einundzwanzigPleb.profile']) ->latest() ->get(); } }; ?>
{{ $post->description }}
Keine News vorhanden.
Du bist nicht berechtigt, die News einzusehen.