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

blapza's avatar

Why does Livewire making disappear relationship query?

I have a select2 its working fine. Its working fine with normal queries but when i list items with eloquent relationships it does not work normally. For example; '' Posts::withCount(['tags' => function($query) use ($category_id){ $query->where('category_id', '=', $category_id); }]->get(); '' This query gives what i wanted to. When list this query in select2 like this; '' @foreach($tagscount as $tagcount)

{{$tagcount->name}} ({{$tagcount->posts_tags_count}}) @endforeach '' It works well but when i select this posts tags count become disappear just tag name left. Why livewire remove relationship elements?
0 likes
0 replies

Please or to participate in this conversation.