@jsartisan Weird. I just ran that query with a many-to-many relationship, and it worked out fine. I'm not sure why it's saying that the id column doesn't exist on yours when you have an id column on your labs, tests, and pivot tables.
I would try this then.
Lab::whereHas('tests', function ($q) uses ($tests) {
$q->whereIn('tests.id', $tests);
})->get();
This query is tricky. With raw sql (pseudo code) :
SELECT l.* FROM labs AS l, lab_test AS t
WHERE l.id = t.lab_id AND t.id IN ($test_ids[0], $test_ids[1], ...)
GROUP BY l.id
HAVING COUNT(DISTINCT t.id) = count($test_ids)
The idea is you select all couple lab/test with a test id in the array. Then group the results by lab id and finally keep only the groups with exactly the expected number of distinct tests.