Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

muuucho's avatar
Level 11

Livewire does not update frontend

When I toggle manage_invoice, to ON, the back end updates and also the frontend, but when I refresh, the frontend is bakc to OFF, while still the backend boolean is 1. Why doesn't the fronted display ON after refresh?

UsersList.php:

users-list.blade.php

0 likes
1 reply
muuucho's avatar
muuucho
OP
Best Answer
Level 11

I found the solutiuon. I had to change render(). I also changed user to teamUser for clarity.

 $tU = TeamUser::query()
            ->select([
                'team_user.*'
            ])->paginate(10);
        $this->teamUsers = collect($tU->items());
        $this->invoice = $this->teamUsers->mapWithKeys(
            fn(TeamUser $item) => [$item['id'] => (bool) $item['manage_invoice']]
        )->toArray();
        return view('livewire.users-list');

Please or to participate in this conversation.