-
-
Notifications
You must be signed in to change notification settings - Fork 863
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
Filter relationship by Yajra laravel-datatable serverside searchbuilder #2726
Comments
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
You can use filterColumn return DataTables::eloquent($model)
->filterColumn('relation_name', function($query, $keyword) {
$query->whereHas('relation', fn($q) => $q->where('relation_name', $keyword));
})
->toJson(); |
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been inactive for 7 days since being marked as stale. |
Okay, thank you very much for your attention. If you can make the code you implemented available in some repository, I can try to do it myself |
Hi friends.
I Use Yajra/laravel-datatable to datatable server side and datatables searchbuilder extension for serverside filter. And this work correctly.
But how to add a relationship field to searchbuilder. For example, in my project, in the admin panel, there is a table containing all the admins of the site and there is no column as the their roles. But I want to search and find users who are operators in searchbuilder. How do I implement this using searchbuilder and yajra?
I am new to datatables, yajra and jquery.
I would be very grateful if you could guide me or introduce me to the tutorial link or in-depth tutorial on this.
Thanks a lot.
Originally posted by @enaeim in #2648 (comment)
The text was updated successfully, but these errors were encountered: