I have a name field in users table. I am storing full name in single field with first name first then last name.
What I want to do is to change the order to last name appearing first and then first name when I call $user->nameRev
and orderBy the new name in laravel.
I already use $user->name
in many places so cannot change that therefore I want $user->nameRev
to reverse the name and use it in orderBy queries
How do I achieve this ?