Oct 17, 2021
0
Level 1
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?Please or to participate in this conversation.