Skip to content

Instantly share code, notes, and snippets.

@kamaulynder
Created September 14, 2016 05:35
Show Gist options
  • Save kamaulynder/c26a31a5641e741a6c3b647bbda1167c to your computer and use it in GitHub Desktop.
Save kamaulynder/c26a31a5641e741a6c3b647bbda1167c to your computer and use it in GitHub Desktop.
<?php
namespace RollCall\Http\Transformers;
use League\Fractal\TransformerAbstract;
class UserTransformer extends TransformerAbstract
{
public function transform(array $user)
{
return [
'id' => (int) $user['id'],
'name' => $user['name'],
'email' => $user['email']
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment