/** * */ public function show($category_slug, $slug) { $board = Board::whereSlug($slug)->firstOrFail(); // @todo figure why can't paginate on getDescendants(); $threads = Post::where('id', $board->id)->first()->getDescendants(); $threads = Thread::whereIn('id', $threads->pluck('id'))->paginate(config('laraboard.thread.limit', 15)); return view('laraboard::board.show', compact('board', 'threads')); }
public function getUnreadAlertsAttribute() { $ids = $this->unreadNotifications->where('data.alert.parent_id', '!=', null)->pluck('data.alert.parent_id')->unique(); return \Christhompsontldr\Laraboard\Models\Thread::whereIn('id', $ids)->get(); }