Query Builder unique

how i can do a Query Builder unique in illuminate

$users = DB::table(‘users’)
->where(‘votes’, ‘>’, 100)

i have like this but with lastname in need to be unique

how i can do that?

You can enforce unique constraints at the database level.


hi but in need with illuminate
becose all my Query is with illuminate

I’m not sure if this is correct (it’s just an idea), but should you be able to simulate this with a “GROUP BY” clause.

hi thanks
i try it and its work
but in need more filter like age
i need he show me the small age
buts the output its group but with the bigger age
(and i put ->order(‘age’) )
and i dont woek :confused: