WhereNot Existists Laravel Eloquent
在雄辩的laravel框架上有点麻烦。
我需要复制这样的查询:
SELECT *
FROM RepairJob
WHERE NOT EXISTS (SELECT repair_job_id
FROM DismissedRequest
WHERE RepairJob.id = DismissedRequest.repair_job_id);
现在我有
$repairJobs = RepairJob::with('repairJobPhoto', 'city', 'vehicle')->where('active', '=', 'Y')->whereNotExists('id', [DismissedRequest::all('repair_job_id')])->get();
有人有想法吗?我需要获取在已消除的请求表中没有记录的所有修复工作
我在使用上面的查询时收到此错误
Argument 1 passed to Illuminate\Database\Query\Builder::whereNotExists() must be an instance of Closure, string given