Skip to content

Need help to understand why sometimes the data of my table is lost after a function and I need to force query again the posts #345

Discussion options

You must be logged in to vote

@joffreypersia Have you tried converting your $users to a computed property?

If you remove the public $users property, then add the method:

#[Computed]
public function users()
{
    return User::all();
}

then, edit your blade view and change any $users to $this->users, it will use the computed property and return the results of the query each time the blade view is rendered.

PS I think you have a typo in your blade view, the 2nd <flux:cell> looks like it doesn't have an opening <a>:

<flux:cell variant="strong" wire:click="edit" class="cursor-pointer">{{ $user->name }}</a></flux:cell>

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by joffreypersia
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants