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->currentPubkey !== '0adf67475ccc5ca456fd3022e46f5d526eb0af6284bf85494c0dd7847f3e5033') { 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