You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
I found that API request adding sent through Request-docs interface is adding double quotes into parameters when using with eloquent LIKE operator. For example if I am sending GET request with parameter &search=test and if I use it in eloquent $model->where('column', 'like', "%{$req->search}%")
I get zero result, and lookinto query output I found that above eloquent is used like: WHERE column LIKE '%\"test\"%'
But when I send the same request through Postman it works fine.
Expected behavior
the query out must be as given below: WHERE column LIKE '%test%'
Screenshots
The text was updated successfully, but these errors were encountered:
Interesting, try once with APP_DEBUG=false in your env file. Seems like the middleware that records sql is causing this.
If that doesn't work, then probably on the frontend, it is adding sanitization.
My bad... I was passing the values incorrectly..
The correct way to pass is &search=test (i.e. without quotes) not &search="test"
I can't believe I didn't realize that earlier!
Thanks for your response @kevincobain2000
And once again, I'm sorry for the oversight.
Description
I found that API request adding sent through Request-docs interface is adding double quotes into parameters when using with eloquent LIKE operator. For example if I am sending GET request with parameter
&search=test
and if I use it in eloquent$model->where('column', 'like', "%{$req->search}%")
I get zero result, and lookinto query output I found that above eloquent is used like:
WHERE column LIKE '%\"test\"%'
But when I send the same request through Postman it works fine.
Expected behavior
the query out must be as given below:
WHERE column LIKE '%test%'
Screenshots
The text was updated successfully, but these errors were encountered: