Term

Statamic\API\Term


Get all terms.

Term::all(); // Returns TermCollection

Get a term by ID.

Term::find($id); // Returns Term

Get a term by slug (and taxonomy).

Term::whereSlug($slug, $taxonomy); // Returns Term

Get a term by URI.

Term::whereUri($uri); // Returns Term

Get all terms in a taxonomy.

Term::whereTaxonomy($taxonomy); // Returns TermCollection

Create a term.

This returns an instance of a TermFactory to allow you to chain and build your term.

Term::create($slug); // Returns TermFactory

Import using:

use Statamic\API\Term