public function updateDisplayName(Request $request)
{
$displayName = $request->get('name');
$displayName = str_replace(' ', ' ', trim($displayName));
$user = $this->user;
XeDB::beginTransaction();
try {
$user = $this->handler->update($user, compact('displayName'));
} catch (\Exception $e) {
XeDB::rollback();
throw $e;
}
XeDB::commit();
return XePresenter::makeApi(['type' => 'success', 'message' => 'success', 'displayName' => $displayName]);
}