Good afternoon.
I’m using PostgreSQL with GCE. The column headers where searches are performed aren’t ILIKE. How can I fix this?
Thanks
Good afternoon.
I’m using PostgreSQL with GCE. The column headers where searches are performed aren’t ILIKE. How can I fix this?
Thanks
Hello @NOLO ,
You can do that by creating a custom Model which you can extend splitFilterValue. The custom model will look like this:
<?php
use GroceryCrud\Core\Model;
class PostgresCustomModel extends Model
{
public function splitFilterValue($filterValue) {
$result = parent::splitFilterValue($filterValue);
$driverName = strtolower($this->getDriverName());
if ($driverName === 'Postgresql' && $result['comparison'] === 'LIKE') {
$result['comparison'] = 'ILIKE';
}
return $result;
}
}
You can see how to set your own Model from here: setModel | Grocery CRUD - A PHP CRUD Generator Library
You can find more about splitFilterValue at file: vendor/grocery-crud/enterprise/src/GroceryCrud/Core/Model.php at around line 398
Let me know if that worked for you.
Regards
Johnny
I use Laravel 12 and postgreSQL, I didn’t find a way to implement it in the controller.
Hello @NOLO ,
This is not in the Controller but as a custom model. So for example your function at the Controller will look like this:
<?php
namespace App\Controllers;
...
class YourController extends BaseController
{
public function customers()
{
...
$crud->setTable('customers');
$crud->setSubject('Customer');
$crud->setModel(new PostgresCustomModel($db));
...
}
}
Let me know if that worked for you.
Regards
Johnny
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Setting quick search values via JavaScript not working properly for booleans |
|
0 | 558 | Nov 2025 |
| callbackColumn() has not effect in v3.2.6 Enterprise |
|
2 | 685 | Dec 2025 |
| displayAs() doesn’t support new line in headings |
|
4 | 857 | Jan 5 |
| Inline edit has problems if the column width is set |
|
2 | 832 | Feb 28 |
| PRINT date format not consistent |
|
6 | 338 | Sep 7 |