update filter column with relation

This commit is contained in:
pbao9
2026-01-30 14:10:59 +07:00
parent cfe38232c3
commit ffbd567a55
2 changed files with 15 additions and 10 deletions
@@ -133,6 +133,11 @@ class Datacenter extends Controller
fn($d) =>
'<a href="' . route('package.datacenter.edit', $d->id) . '" class="btn btn-primary btn-sm">Edit</a>'
)
->filterColumn('v_center.host', function ($query, $keyword) {
$query->whereHas('vCenter', function ($q) use ($keyword) {
$q->where('host', 'like', "%{$keyword}%");
});
})
->make(true);
}