plebs = $this->loadPlebs(); } protected $listeners = [ 'nostrLoggedOut' => 'handleNostrLoggedOut', 'nostrLoggedIn' => 'handleNostrLoggedIn', ]; public function mount(): void { if (NostrAuth::check()) { $this->currentPubkey = NostrAuth::pubkey(); $this->currentPleb = \App\Models\EinundzwanzigPleb::query() ->where('pubkey', $this->currentPubkey)->first(); $allowedPubkeys = [ '0adf67475ccc5ca456fd3022e46f5d526eb0af6284bf85494c0dd7847f3e5033', '430169631f2f0682c60cebb4f902d68f0c71c498fd1711fd982f052cf1fd4279', '7acf30cf60b85c62b8f654556cc21e4016df8f5604b3b6892794f88bb80d7a1d', 'f240be2b684f85cc81566f2081386af81d7427ea86250c8bde6b7a8500c761ba', '19e358b8011f5f4fc653c565c6d4c2f33f32661f4f90982c9eedc292a8774ec3', 'acbcec475a1a4f9481939ecfbd1c3d111f5b5a474a39ae039bbc720fdd305bec', ]; if (in_array($this->currentPubkey, $allowedPubkeys, true)) { $this->isAllowed = true; } } $this->plebs = $this->loadPlebs(); } private function loadPlebs() { $query = EinundzwanzigPleb::query() ->with([ 'profile', 'paymentEvents' => fn ($query) => $query ->where('year', date('Y')) ->where('paid', true), ]); if ($this->search) { $query->where(function ($query) { $query->whereHas('profile', function ($query) { $query->where('name', 'ilike', '%'.$this->search.'%'); })->orWhere('npub', 'like', '%'.$this->search.'%'); }); } if ($this->showPaidOnly) { $query->whereHas('paymentEvents', fn ($query) => $query ->where('year', date('Y')) ->where('paid', true) ); } return $query->tap(fn ($query) => $this->sortBy ? $query->orderBy($this->sortBy, $this->sortDirection) : $query) ->get(); } public function sort(string $column): void { if ($this->sortBy === $column) { $this->sortDirection = $this->sortDirection === 'asc' ? 'desc' : 'asc'; } else { $this->sortBy = $column; $this->sortDirection = 'asc'; } $this->plebs = $this->loadPlebs(); } public function togglePaidFilter(): void { $this->showPaidOnly = !$this->showPaidOnly; $this->plebs = $this->loadPlebs(); } public function openPaymentModal(int $plebId): void { $this->selectedPlebId = $plebId; Flux::modal('payment-details')->show(); } public function accept($rowId): void { $this->confirmAcceptId = $rowId; Flux::modal('confirm-accept-pleb')->show(); } public function delete($rowId): void { $this->confirmDeleteId = $rowId; Flux::modal('confirm-delete-pleb')->show(); } public function acceptPleb(): void { if ($this->confirmAcceptId) { $pleb = EinundzwanzigPleb::query()->findOrFail($this->confirmAcceptId); $for = $pleb->application_for; $text = $pleb->application_text; $pleb->association_status = AssociationStatus::from($for); $pleb->application_for = null; $pleb->archived_application_text = $text; $pleb->application_text = null; $pleb->save(); $this->confirmAcceptId = null; Flux::modal('confirm-accept-pleb')->close(); } } public function deletePleb(): void { if ($this->confirmDeleteId) { $pleb = EinundzwanzigPleb::query()->findOrFail($this->confirmDeleteId); $pleb->application_for = null; $pleb->application_text = null; $pleb->save(); $this->confirmDeleteId = null; Flux::modal('confirm-delete-pleb')->close(); } } public function closePaymentModal(): void { $this->selectedPlebId = null; Flux::modal('payment-details')->close(); } #[Computed] public function selectedPleb(): ?EinundzwanzigPleb { return EinundzwanzigPleb::with(['paymentEvents'])->find($this->selectedPlebId); } }; ?>
Zugriff auf die Mitgliederverwaltung ist nur für spezielle autorisierte Benutzer möglich.
@if(!NostrAuth::check()) Bitte melde dich zunächst mit Nostr an. @else Dein Benutzer-Account ist nicht für diese Funktion autorisiert. Bitte kontaktiere den Vorstand, wenn du Zugriff benötigst. @endif