Definitions
Generating Commands (0)
Query Builder (11) -> Now it should show 0 instead showing 11
Resource Controllers (0)
Seeding (0)
Basically the error was happening because of incorrect filtering of
posts tbl with topic_id only. So, if post filtering was required with
both community_id and topic_id, the calculation of post counting was
showing incorrect.
Took 2 hours to implement it..
DB changes
1. Added community_id into posts tbl
Script changes
1. Removed TopicPostController
2. Added CommunityTopicPostController and added community into add, edit, show and post comment form..
3. Updated index.blade.php under resources/communities folder with following
$topic->posts->where('community_id',$community->id)->count()