FutureWeb
3 years ago

concat? is there an option for this?

Posted 3 years ago by FutureWeb

lets say I want to search by first and last name together or just first name

    where(CONCAT_WS(' ', 'first_name', 'last_name') LIKE '%'.$query.'%')
            ->orWhere('first_name','LIKE','%'.$query.'%');

I am sure there must be a simple way to do this and I am just being thick :)

Thanks in advance

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