spatie / laravel-translatable

Making Eloquent models translatable

Home Page:https://spatie.be/docs/laravel-translatable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel like query for particular language

bansivaishnani opened this issue · comments

Hello guys,

I used below query and getting me error.

QUERY: $query->where('name->en','%'.$request['filters'][$requestName].'%');

ERROR: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: character varying ->> unknown\nLINE 1: ...count() as aggregate from "products" where "name"->>'en' = ...\n ^\nHINT: No operator matches the given name and argument types. You might need to add explicit type casts. (SQL: select count() as aggregate from "products" where "name"->>'en' = %Shoes%)

Can you please suggest

I used Laravel 8 with PostgreSQL.

Thanks in advance