Exemplo n.º 1
0
 /**
  * 所有帖子列表接口的通用部分.
  *
  * @return \Dingo\Api\Http\Response
  */
 protected function commonIndex()
 {
     FilterManager::addFilter('newest');
     $this->registerListApiIncludes();
     $data = $this->topics->autoWith()->autoWithRootColumns(['id', 'title', 'is_excellent', 'reply_count', 'updated_at', 'created_at', 'vote_count'])->paginate(per_page());
     return $this->response()->paginator($data, new TopicTransformer());
 }