Level 2
@cunlayogd First of all can you put your code in the ``` so everyone can actually read this: https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code
Hi all, how can I merge this two queries into a single query.
$jobLocations = DB::table('job_post_locations')
->join('locations', 'job_post_locations.location_id', '=', 'locations.id')
->select('locations.id','locations.name',DB::raw('count(*) as location_count'))
->groupBy('location_id')
->get();
$jobIndustries = DB::table('job_post_industries')
->join('industries', 'job_post_industries.industry_id', '=', 'industries.id')
->select('industries.id','industries.name',DB::raw('count(*) as industry_count'))
->groupBy('industry_id')
->get();
Please or to participate in this conversation.