for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace League\Fractal\Test\Stub\Transformer;
use League\Fractal\TransformerAbstract;
class JsonApiAuthorTransformer extends TransformerAbstract
{
protected $availableIncludes = [
'published',
];
public function transform(array $author)
unset($author['_published']);
return $author;
}
public function includePublished(array $author)
if (! isset($author['_published'])) {
return;
return $this->collection(
$author['_published'],
new JsonApiBookTransformer(),
'books'
);