query builder not in laravel

103

query builder "not in" laravel -

$result = Exams::whereNotIn('id', function($q){
        $q->select('examId')->from('testresults');
    })->get();

Comments

Submit
0 Comments