Closed abanghendri closed 2 years ago
Can you paste your columns()
here?
It's because the role
column does't have right name, you need to custom searcahble
on roles column..
That is all datatables problem with raw query. You need to do something like this:
Column::make('Role')
->searchable(function(Builder $query, $term) {
return $query->orWhere('roles.name', 'like', '%' . trim($term) . '%');
});
Just use custom search and add full field name. It should work.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi, I have a query like this
and when I search something, I got this error:
This is my data looks like, and I want to search everything, all works except role, when I don't use searchable() on role column, it works fine
I know there's no 'role' column in those tables, but I have to search roles.name which has the same field name with users table