Пример #1
0
 /**
  * Get the forum, ready to be serialized and assigned to the JsonApi
  * response.
  *
  * @param JsonApiRequest $request
  * @param Document $document
  * @return \Flarum\Core\Forum
  */
 protected function data(JsonApiRequest $request, Document $document)
 {
     $forum = app('flarum.forum');
     $forum->groups = Group::whereVisibleTo($request->actor)->get();
     return $forum;
 }