src/Press/Models/Category.php
public function newWithCreateTerm($term): self
    {
        $newTerm = Term::firstOrCreate($term);
        $this->term_id = $newTerm->id;
        $this->term()->associate($newTerm);
        $this->setTaxonomy();

        return $this;
    }
public function newWithCreateTerm($term): self
    {
        $newTerm = Term::firstOrCreate($term);
        $this->term_id = $newTerm->id;
        $this->term()->associate($newTerm);
        $this->setTaxonomy();

        return $this;
    }
public function newWithCreateTerm ( $ term ) : self { $ newTerm = Term :: firstOrCreate ( $ term ) ; $ this -> term_id = $ newTerm -> id ; $ this -> term ( ) -> associate ( $ newTerm ) ; $ this -> setTaxonomy ( ) ; return $ this ; }
Create category term.

@param array $term

@return self
Create category term .