Last active
February 6, 2017 17:20
-
-
Save joetannenbaum/cf6edd15608fb2a49a0fbb79ab7e9981 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class UserTransformer extends TransformerAbstract | |
{ | |
public function transform(User $user) | |
{ | |
return [ | |
// Make sure to hash any IDs before returning | |
'id' => Hasher::encode($user->id), | |
'first_name' => $user->first_name, | |
'last_name' => $user->last_name, | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment