false]); state(['currentPubkey' => null]); state(['elections' => []]); mount(function () { $this->elections = \App\Models\Election::query() ->get() ->toArray(); }); 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 redirect()->route('association.profile'); } $this->isAllowed = true; }, ]); $saveElection = function ($index) { $election = $this->elections[$index]; $electionModel = \App\Models\Election::find($election['id']); $electionModel->candidates = $election['candidates']; $electionModel->save(); }; ?> @volt
@foreach($elections as $election)
{{ $election['year'] }}
@endforeach
@endvolt