/** * Retrive all threads that belongs board * * @return App\Classes\ForumPost */ public function threads() { $rows = app('forumpost')->where(function ($query) { $query->where('is_reply', 0); $query->where('board_id', $this->id); })->orderBy('created', 'desc')->paginate(config('forum', 'threads.per_page'))->appends(['subtopic' => 'forum', 'board' => $this->id]); $presenter = app('ThemeLoader')->config('presenter.forum-replies'); static::$pagination = with(new $presenter($rows)); return $rows; }
/** * Set pagination object * * @return void */ public function setPagination($items) { $presenter = app('ThemeLoader')->config('presenter.highscores'); static::$pagination = with(new $presenter($items)); }