Use null coalescence

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-07-04 13:22:56 +01:00
parent e372527d13
commit c57f1f9d7d

View file

@ -24,7 +24,7 @@ class UsersTransformer
$array = [ $array = [
'id' => (int) $user->id, 'id' => (int) $user->id,
'avatar' => e($user->present()->gravatar), 'avatar' => e($user->present()->gravatar) ?? null,
'name' => e($user->getFullNameAttribute()), 'name' => e($user->getFullNameAttribute()),
'first_name' => e($user->first_name), 'first_name' => e($user->first_name),
'last_name' => e($user->last_name), 'last_name' => e($user->last_name),