Nechalon
03/13/2023, 10:42 AMSQLSTATE[42S22]: Column not found: 1054 Unknown column 'user.name' in 'order clause' error when clicking on the name to order it.
public function order($query, array $orders = [])
{
if (array_key_exists('user_name', $orders)) {
$direction = $orders['user_name'];
unset($orders['user_name']);
$query->with('user')->orderBy('user.name');
}
return parent::order($query, $orders);
}
Its complaining about the user.name field, I have tried user_name and name there, but its the same.
The $indexColumns array looks like this
'Name' => [
'title' => 'Name',
'field' => 'user_name',
'sort' => true,
],