I have a table named answers and its columns are id
, answers
, batch
, candidate_id
. I want to get all candidates that has no record of answers under batch number of 1.
Is there a way to add condition to this statement (this is in my candidate model) ?
return $this->has('answers', '=', 0)->get();
I tried this way but it didn't work:
return $this->has('answers', '=', 0)->whereBatch(1)->get();