I am having some trouble in Laravel using the query builder to select users based on two where clauses. The first where clause would contain multiple where statements to select a user based on some conditions. If this fails in the OR part I would like to check simply if the user ID is in the array. Would be grateful for some advice on how I could achieve this. Thanks.
$rs = DB::table('tblUser')
->select('name')
->where(function($q) {
$q->where(function($q){
$q->where('fid', '=', $this->argument('fid'))
->where('type', '<', 10)
})
->orWhereIn('id', $userIdSArray);
})
->get();
->orWhereIn. If I just try->orWhere('id', '123'); this just runs fine. So there is something wrong on that part.->get()with->toSql()? What's the content of$userIdSArray?$userIdsArray = ['123', '456'];I don't get anything if idd($rs)while usingtoSql()in the above