Use strtolower on both sides of like to make the search lowercase only.
Apr 7, 2018
6
Level 2
How can I solve case-sensitive where like statement on json data in Laravel eloquent?
I use Laravel 5.6 and mysql database.
My Laravel eloquent query is like this:
Order::where('information->owner', 'like', '%'.$receipt.'%')->paginate(5);
Information field is a JSON type.
{"owner": "Chelsea"}
If $receipt is Chel, the query returns a result.
But if $receipt is chel or CHEL, the result is empty
How can I solve this problem?
Please or to participate in this conversation.