opv
2 weeks ago

How to use Max and Min in Laravel?

Posted 2 weeks ago by opv

Hi,

I think laravel is returning my wrong data. Don't know why?

$groups = Groups::where("min", '>=', $result->Z)
    ->where("max", '<=', $result->Z)
    ->orderBy('min')
    ->get();

Where $result->Z is 52.850294770880225.

In my table, I should able to get the raw-

4 | 47.01 | 52.99 | 0

But I am getting empty instance.

Can you guys help me for that?

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