Zeta
DB::table('user_details')
->selectRaw('
provinces.name AS province,
COUNT(DISTINCT posts.id) AS posts_count,
COUNT(DISTINCT questions.id) AS questions_count,
COUNT(DISTINCT advertisements.id) AS advertisements_count,
COUNT(DISTINCT posts.id) + COUNT(DISTINCT questions.id) + COUNT(DISTINCT advertisements.id) AS total
')
->leftJoin('provinces','user_details.province_id','=','provinces.id')
->leftJoin('posts','user_details.user_id','=','posts.user_id')
->leftJoin('questions','user_details.user_id','=','questions.user_id')
->leftJoin('advertisements','user_details.user_id','=','advertisements.user_id')
->groupBy('user_details.province_id','provinces.name')
->get();
+----------+-------------+-----------------+----------------------+-------+
| province | posts_count | questions_count | advertisements_count | total |
+----------+-------------+-----------------+----------------------+-------+
| Istanbul | 3 | 3 | 3 | 9 |
| Ankara | 2 | 0 | 1 | 3 |
+----------+-------------+-----------------+----------------------+-------+
https://www.db-fiddle.com/f/7ybWLd5WAodtpgcFG2SmtC/1