Answer the question
In order to leave comments, you need to log in
How to find out how many posts are stored in a category?
Good time, question.
There are let's say 5 categories, in each category there are entries in a different number.
How to make it so that under each category you can see how many records it currently stores in itself Like
this:
Category_1 (29)
Category_2 (5)
Category_3 (16)
Category_4 (2)
Category_5 (96)
My categories are displayed like this right now. How else can I add the number of records they have here?
public static function getOneBlockInSidebarAdmin() {
return = DB::table('tags')->where('id_category_sidebar', 'OneBlock')->get();
}
Answer the question
In order to leave comments, you need to log in
Make queries to the database...
https://www.w3schools.com/sql/func_mysql_count.asp
https://laravel.com/docs/5.6/queries#aggregates
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question