public function addTerm($term_id)
    {
        TermContainer::findOrFail($term_id);

        // Cancel if the user wants to add the same term again
        if ($this->getTaxonomyQuery()->where('term_id', $term_id)->count()) {
            return;
        }

        $this->taxonomies()->attach($term_id);

        Cache::forget($this->getTaxonomyCacheKey());
    }
public function addTerm($term_id)
    {
        TermContainer::findOrFail($term_id);

        // Cancel if the user wants to add the same term again
        if ($this->getTaxonomyQuery()->where('term_id', $term_id)->count()) {
            return;
        }

        $this->taxonomies()->attach($term_id);

        Cache::forget($this->getTaxonomyCacheKey());
    }
public function addTerm ( $ term_id ) { TermContainer :: findOrFail ( $ term_id ) ; // Cancel if the user wants to add the same term again if ( $ this -> getTaxonomyQuery ( ) -> where ( 'term_id' , $ term_id ) -> count ( ) ) { return ; } $ this -> taxonomies ( ) -> attach ( $ term_id ) ; Cache :: forget ( $ this -> getTaxonomyCacheKey ( ) ) ; }
Link a term to this content

@param int $term_id
Link a term to this content