Laravel Search Comma Separated values – FIND_IN_SET Query Builder

If you want search comma separated value in Laravel Query Builder ,

here is a way to do it

whereRaw(‘FIND_IN_SET(‘2′,userid)’)

where the userid is column name which is holding the values of user-id as 1,2,3,4.

Advertisements