MedicOneSystems / livewire-datatables

Advanced datatables using Laravel, Livewire, Tailwind CSS and Alpine JS
https://livewire-datatables.com/
MIT License
1.19k stars 258 forks source link

Error when filtering on UUID #517

Closed Kevoniat closed 1 year ago

Kevoniat commented 1 year ago

SQLSTATE[42883]: Undefined function: 7 ERROR: function lower(uuid) does not exist LINE 1: ...elect count(*) as aggregate from "users" where (((LOWER(user... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.

select count(*) as aggregate from "users" where (((LOWER(users.id) like %97a35124-4127-43ce-a7d5-a6e4a0b3fcf3%))) ` // DataTable public $model = User::class;

public function builder()
{
    return User::query();
}

public function columns()
{
    return [
        Column::name('id')
        ->filterable()
            ->label('Borrower Id'),

        Column::name('email')
        ->label('Email')
        ->filterable()
        ->defaultSort('asc'),

        Column::name('trn')
        ->label('Trn')
        ->filterable()
        ->defaultSort('asc'),

        Column::name('gender')
        ->filterable()
        ->label('Status'),

        DateColumn::name('created_at')
        ->filterable()
        ->label('Registration Date'),

    ];
}

// User model public $keyType = 'string';

public $incrementing = false;

`