-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #13495 added setting for name order #13496
Conversation
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
PR Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple minor notes but nothing to hold this back. Looks good 😄
@@ -24,7 +24,7 @@ public function transformUser(User $user) | |||
$array = [ | |||
'id' => (int) $user->id, | |||
'avatar' => e($user->present()->gravatar), | |||
'name' => e($user->first_name).' '.e($user->last_name), | |||
'name' => e($user->getFullNameAttribute()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure you already know this but because this is an accessor on the user model we can do $user->full_name
instead of having to call the method.
Is calling the method an intentional pattern that I should start following?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The get*Attribute()
syntax tells Laravel to allow it to be accessed like a "normal" property so you could do $user->full_name
.
I'm 99% sure there is no benefit doing it that way but I normally don't see the full get*Attribute()
call in code.
Signed-off-by: snipe <[email protected]>
This should fix #13495, where a Korean user mentioned that in Korea, names are displayed last name first. This adds a setting in
Settings > Localization
that will let the admin decide whether names should be presented last name first or first name first. I also found a method that I don't think we use anymore.