Closed wardemi closed 7 years ago
Hi, yes you are right, it doesn't work. But after extending columns.yaml
you can try this dirty workaround in UserExportModel.php
:
public function exportData($columns, $sessionKey = null)
{
$return = [];
$users = User::all();
$users->each(function($user) use ($columns, &$return) {
$user->addVisible($columns);
$array = $user->toArray();
$array['country'] = $user->country->name;
$array['state'] = $user->state->name;
$return[] = $array;
});
return $return;
}
Please send PR if you solve it by some systematic way.
Hi,
How to export User Location Country name? I extended your "export columns.yaml" but I had empty string.
Thanks