Search list defined with a model function #469
Replies: 1 comment 2 replies
-
You can define your own search logic for columns using the $this->crud->addColumn([
'name' => 'employé.nom',
'type' => 'relationship',
'label' => 'Nom',
'searchLogic' => function ($query, $column, $searchTerm) {
$query->whereHas('employe', function ($q) use ($column, $searchTerm) {
$q->where('nom', 'like', '%'.$searchTerm.'%');
});
}
]); See https://backpackforlaravel.com/docs/5.x/crud-columns#custom-search-logic for more info. Hope it helps! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
Having a hard time figuring this one. I've got a simple list using a model function :
How can I get the column search to work ?
Beta Was this translation helpful? Give feedback.
All reactions