App\Models\Forum\Forum::lastTopic PHP Method

lastTopic() public method

public lastTopic ( $recursive = true )
    public function lastTopic($recursive = true)
    {
        $key = $recursive === true ? 'recursive' : 'current';
        if (isset($this->_lastTopic[$key]) === false) {
            $this->_lastTopic[$key] = Topic::whereIn('forum_id', $recursive ? $this->allSubforums() : [$this->forum_id])->orderBy('topic_last_post_time', 'desc')->first();
        }
        return $this->_lastTopic[$key];
    }