cunlayogd

Experience

60

0 Best Reply Awards

  • Member Since 1 Week Ago
  • 0 Lessons Completed
  • 0 Favorites

14th June, 2018

cunlayogd left a reply on Eloquent Merge Two Queries • 1 week ago

@mballaag thank you, I have formatted the code

cunlayogd left a reply on Count Distinct Column In A Relationship • 1 week ago

Thanks @mballaag I formatted the codes already

cunlayogd started a new conversation Filtering Multiple Relationships • 1 week ago

Hi guys, I have a jobPost model that has a relationship with JobLocation model. How can I get count of distinct locations in my jobPost table using eloquent.

This works

$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();

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.