[]]); mount(function () { $this->elections = \App\Models\Election::query() ->get() ->toArray(); }); updated([ ]); $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