ifox
03/10/2023, 2:18 PMNechalon
03/10/2023, 2:19 PMifox
03/10/2023, 2:20 PMNechalon
03/10/2023, 2:31 PMgetUserNameAttribute
and getUserEmailAttribute
functions and set up the relation correctly (I believe), now it shows the columns on the table row, but cant sort it yetNechalon
03/10/2023, 2:39 PMjefsev
03/10/2023, 3:05 PMifox
03/10/2023, 3:58 PMifox
03/10/2023, 3:58 PMAntonyPL
03/10/2023, 4:18 PMsathish
03/11/2023, 10:46 AMifox
03/11/2023, 10:47 AMAntonyPL
03/11/2023, 4:43 PMifox
03/11/2023, 4:54 PMAntonyPL
03/11/2023, 4:56 PMAntonyPL
03/11/2023, 5:03 PMAntonyPL
03/12/2023, 6:44 PMAntonyPL
03/12/2023, 8:46 PMMD
03/13/2023, 2:30 AMprepareFieldsBeforeSave()
of your repository so it saves to the database (and conversely to strip it out in getFormFields()
) or to add it everywhere it's used with something like a model attributeMD
03/13/2023, 2:31 AMMD
03/13/2023, 2:31 AMNechalon
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,
],
ifox
03/13/2023, 10:46 AMifox
03/13/2023, 10:46 AMEdex
03/13/2023, 12:12 PMNechalon
03/13/2023, 12:21 PMifox
03/13/2023, 12:22 PMifox
03/13/2023, 12:23 PMNechalon
03/13/2023, 12:25 PMifox
03/13/2023, 12:27 PMgetColumnInTwillIndexAttribute()
and in your indexColumns use column_in_twill_index
Nechalon
03/13/2023, 12:28 PM