Socieboy\Forum\Entities\Conversations\ConversationRepo::topic PHP Method

topic() public method

Return all conversations of the topic given
public topic ( string $topic_id ) : mixed
$topic_id string
return mixed
    public function topic($topic_id)
    {
        return $this->model->where('topic_id', $topic_id)->latest()->paginate(10);
    }

Usage Example

Example #1
0
 /**
  * Display the main page of the forum.
  * All conversations are listed.
  *
  * @param string $topic_id
  * @return \Illuminate\View\View
  */
 public function topic($topic_id)
 {
     $conversations = $this->conversationRepo->topic($topic_id);
     return view('Forum::index', compact('conversations'));
 }
ConversationRepo