Reputation: 13
I want to get jobs count from the jobs table which are having at least one application. I try with this,
$jobs_count = Job::withCount('allApplications')->having('all_applications_count', '>', 0)->count();
but Unknown column 'allApplications_count' error. how to fix that? but,
$jobs_count = Job::withCount('allApplications')->having('all_applications_count', '>', 0)->get();
this is working.
Upvotes: 1
Views: 262