I have a 1 category and subcategory table table name: categories
another table is posts posts table
when click on google app script all post regarding category and sub category of google app script will show enter image description here
my controller code is and name of controller is bloglistController
$posts = post::where('category_id', $id)->paginate(7);
but this code shows only category id post I want post of both category and sub category