dilfdo
3 years ago

Getting opposite results from laravel sql resutls

Posted 3 years ago by dilfdo

I want to get the opposite results of my current querey. which means to get the results which not coming under current query. how can i proceed this ?

my current querry is

    $fod = FodMap::select('*')
        ->where('fructose_level', $fructose == 1 ? '=' : '>=', $fructose)
        ->where('lactose_level', $lactose == 1 ? '=' : '>=', $lactose)
        ->where('polyols_level', $polyols == 1 ? '=' : '>=', $polyols)
        ->where('fructan_level', $fructan == 1 ? '=' : '>=', $fructan)
        ->get();

how to get everything that doesn't fall under the above query. pls advice

Please sign in or create an account to participate in this conversation.