-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to search on column translatable #199
Comments
I no know. |
Does anyone have a solution? I am facing the same problem. So far my solution is via the join configuration:
But all translations are always returned and so I have each modal n times, where n is the number of possible translations. |
Hi all, I'm using this code: $prods = Product::whereIn('product_id', function($query) use ($search){
return $query->fromSub(
ProductTranslation::search($search, 0)->select('product_id')->distinct(),
'tmp'
);
})->get(); where protected $searchable = [
/**
* Columns and their priority in search results.
* Columns with higher values are more important.
* Columns with equal values have equal importance.
*
* @var array
*/
'columns' => [
'products_translations.product_name' => 10,
'products_translations.product_description' => 5,
],
]; this works, but there is for sure better way to do this |
i use this library https://github.com/Astrotomic/laravel-translatable/ how to search on colum translatable?
The text was updated successfully, but these errors were encountered: