leftJoin('blog_categories', 'blog_categories.id', 'blog_articles.cate_id') ->where('blog_categories.cate_name', '=', $category) ->select( 'cate_id', 'slug', 'title', 'read_count', 'created_at', 'is_top', 'description') ->orderByDesc('is_top')->orderByDesc('created_at'); $data = $data->paginate($size)->toArray(); $this->sidebar($data); return view('home.index', $data); } }