/** * Return an index of existing post type fields. * * @param FieldTableBuilder $table * @param PostModel $model * @return \Symfony\Component\HttpFoundation\Response */ public function index(FieldTableBuilder $table, PostModel $model) { $table->setStream($model->getStream()); return $table->render(); }
/** * Get featured posts. * * @return EntryCollection */ public function getFeatured($limit = null) { return $this->model->enabled()->where('featured', true)->paginate($limit); }
/** * Get recent posts. * * @return EntryCollection */ public function getRecent($limit = null) { return $this->model->with(['category'])->orderBy('created_at', 'DESC')->paginate($limit); }