I am new to laravel and face a problem building a simple query:
$query->orWhere("CONCAT(`nvp`, ' ', `vpv`)", 'LIKE', "%$this->searchNeedle%");
This line above is one of several conditions in an encapsulated query condition. I think the other lines are not necessary for this case but tell me if you need to see them.
I found out that the developer decided to add a
`
before and after the first orWhere/where param which cause the problem that I cant use a simple concat, because the line above will result in:
`CONCAT(`vpv`, ' ', `nvp`)` LIKE ?)'
↑ ↑
this & this
Since this is automagically added i cant remove it without overwriting a laravel-core function which i wont. Is there any SQL-based "hack" that handles these two ` ? Something in the way like 1 = 1, you know?
Maybe you have another solution for me to get the intended result, comparing one string with two rows in combination?