To get that count, I think what you really want is the Job->applicants:
\App\Job::find($jobId)->applicants->count()
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi all, I have one query issue. I have small table. having four columns that are customer_id, job_id and timestamp. I already created one to one relationship. for both tables now the issue is I want to to show the total applicants applied for the same job. My Query at the moment is
CustomerJobApplication::with(['jobApplied' , 'customer')->where('customer_id',auth()->guard('customer')->id())->get(); My requirement is that i need the total applicants applied for each job also Thanks
To get that count, I think what you really want is the Job->applicants:
\App\Job::find($jobId)->applicants->count()
Please or to participate in this conversation.