dispatch('showPostCardInModal', id: $id); } public function render() { $posts = Post::orderBy('id', 'desc'); if ($this->category && $this->category != 'all') $posts = $posts->where('category', $this->category); if ($this->count) $posts = $posts->take($this->count)->get(); else $posts = $posts->take(10)->get(); return view('post::list.cards', [ 'posts' => $posts ]); } }