I have this PostgreSQL query which checks a value if it matches one of the string pattern in the table:
SELECT * FROM table WHERE 'value' LIKE column
I want to do this in Laravel 5.1 using Eloquent. But doing something like :
$prefix = 'value';
Model::where($prefix, 'LIKE', column)->firstOrFail();
returns an error. Apparently the first argument of where ($prefix) will always be treated as column name in Laravel (put between double quotes). Is there anyway to fix this or any better way to do it?