dimanche 5 janvier 2020

laravel search incasesensitive query builder

i have a problem here, i want to create a filter, but in my database it turns out to be case-sensitive, i tried with my lower query string but it didn't work, i have some error call undfiend lcase

 $type = strtolower($type);
        $name = strtolower($name);
        $users  = DB::table('daftar.bank_list AS uc')
                        ->leftJoin('users.users as u','u.bank_id','=','uc.id')
                        ->when($type, function ($query, $type) {
                            return $query->where('LCASE'('uc.type'), $type);
                        })
                        ->when($name, function ($query, $name) {
                            return $query->where('LCASE'('uc.name'), $name);
                        })
                        ->get();

my database is postgresql



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire