I want to search by title. But the title field is another table. I am using this package
https://github.com/dimsav/laravel-translatable
Here are the tables structure :
****** Files *******
id | slug
******** FileTranslation ********
id | file_id | title | description
Manual search worked for me.
->filter(function ($query) {
if(request()->has('search') && isset(request()->input('search')['value']) && !empty(request()->input('search')['value'])){
$search_term = request()->input('search')['value'];
$query->whereTranslationLike('title', "%". $search_term . "%");
}
})
Glad you sorted out this one. Thanks for sharing the solution.
Most helpful comment
Manual search worked for me.