My SQL query is:
SELECT* FROM cubes LEFT JOIN xkvs ON cubes.id=xkvs.cube_id WHERE xkvs.cube_id IS NULL
I tried the method from the laravel documentation but always get an error, that xkvs.cubes_id is an unknown column.
How do I write this correctly?
This is my try:
$cubes=DB::table('cubes')
->leftjoin('xkvs', function ($join) {
$join->on('cubes.id', '=', 'xkvs.cubes_id')
->where('xkvs.cubes_id', '=', null);
})
->get();