The following options are compatible with MySQL, but with Postgresql they do not work accordingly.
$this->whereLike($column, $string)
$query->where($column, 'LIKE', '%'.$string.'%')
$this->whereBeginsWith($column, $string)
$query->where($column, 'LIKE', $string.'%')
$this->whereEndsWith($column, $string)
$query->where($column, 'LIKE', '%'.$string)
A simple change from "LIKE" to "ILIKE" (case-insensitively) would be necessary to make it work with Postgresql.
However, it would have to be done "automatically" or pass as a parameter according to QueryBuilder Equivalent.
In the "automatic" form, you can check the type of connection (DB_CONNECTION) that Laravel is using, as Laravel already has predefined connections, this test would give to check if the connection would be of the "mysql" or "pgsql" type and thus defining whether "LIKE" or "ILIKE" is used.
Hi,
The following options are compatible with MySQL, but with Postgresql they do not work accordingly.
A simple change from "LIKE" to "ILIKE" (case-insensitively) would be necessary to make it work with Postgresql.
However, it would have to be done "automatically" or pass as a parameter according to QueryBuilder Equivalent.
In the "automatic" form, you can check the type of connection (DB_CONNECTION) that Laravel is using, as Laravel already has predefined connections, this test would give to check if the connection would be of the "mysql" or "pgsql" type and thus defining whether "LIKE" or "ILIKE" is used.