Table relationship sort error.

What is wrong in below code. I get error while sorting.
TextColumn::make('member.memberable.name')
->label('Company')
->wrap()
->searchable()
->sortable(),
TextColumn::make('member.memberable.name')
->label('Company')
->wrap()
->searchable()
->sortable(),
2 Replies
toeknee
toeknee4mo ago
You need to modiofy the eloquent query to load the relationships on the table level, opposed to on the column level if I remember correctly.
Pritbor
PritborOP4mo ago
Thanks @toeknee . You mean have $name = 'member.memberable.name' in table and use $name in column. I tried this and it gives same error. But then i wrote callback query inside sortable()
Want results from more Discord servers?
Add your server