Concatenate columns? #477
Unanswered
jrmypttrsn
asked this question in
Q&A
Replies: 1 comment
-
Something like (freehanding this): Column::make('Contact')
->searchable(function(Builder $builder, $term) {
return $builder->orWhere('first_name', 'like', '%'.$term.'%')
->orWhere('last_name', 'like', '%'.$term.'%')
})
->format(function($value, $column, $row) {
return $row->first_name . ' ' . $row->last_name;
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to make a column out of two database columns? I have 'contact_first_name' and 'contact_last_name' that I would like to put in a
Column::make('Contact')->searchable()
. Am I just missing this in the documentation?Beta Was this translation helpful? Give feedback.
All reactions