I am trying to list subcategory name by category_id where category_id should be grouped and show all subcategory name of that grouped id. Please see the attached figure shown in below:-
In my web page category name shown repeatedly but I want category should be display one and subcategory name should be display. For example:-
category name || subcategory name||
Data Management || pa , roji ||
Executive || lov, true ||
My simple using relationship query is:-
TeamSubCategory::with('category')->orderBy('weight')->get();
via Pawan Dongol