Merge pull request #40 from dshoreman/eagerload

Lazy-load any included relationships on /api/tags
This commit is contained in:
Toby Zerner 2017-04-12 06:38:29 +09:30 committed by GitHub
commit 49504da31e

View File

@ -57,7 +57,10 @@ class ListTagsController extends AbstractCollectionController
protected function data(ServerRequestInterface $request, Document $document)
{
$actor = $request->getAttribute('actor');
$include = $this->extractInclude($request);
return $this->tags->whereVisibleTo($actor)->withStateFor($actor)->get();
$tags = $this->tags->whereVisibleTo($actor)->withStateFor($actor)->get();
return $tags->load($include);
}
}