1. Showing appropriate post count for community and topic
$communities = Community::with(['topics'])->where('user_id', auth()->id())->orderBy('id', 'desc')->get(); @forelse ($community->topics as $topic) {{ $topic->name }} ({{ $topic->posts->where('community_id',$community->id)->count() }}) @empty
No topics yet.</small> @endforelse
Comment::where('post_id',$community->posts->pluck('id'))->delete(); $community->posts->each->delete(); $community->topics->each->delete(); $community->delete();
sdf