Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

Taking your approach on designing things actually makes it fun, more natural, and overall easier.

— Dominik, Developer

Taxonomy Repository

To work with the with Taxonomy Repository, use the following Facade:

use Statamic\Facades\Taxonomy;


Methods Description
all() Get all Taxonomies
find($id) Get Taxonomy by id
findByHandle($handle) Get Taxonomy by handle
findByUri($mount) Get Taxonomy by uri
findOrFail($id) Get Taxonomy by id. Throws a TaxonomyNotFoundException when the taxonomy cannot be found.
handleExists($handle) Check to see if Taxonomy exists
handles() Get all Taxonomy handles
queryTerms() Query Builder for Terms
make() Makes a new Taxonomy instance
Hot Tip!

The id is the same as handle while using the default Stache driver.


While the Taxonomy Repository does not have a Query Builder, you can still query for Terms inside Taxonomies with the queryTerms method. This approach can be useful for retrieving Terms with an existing Taxonomy object.

$tags = Taxonomy::find('tags');

When a taxonomy can't be found, the Taxonomy::find() method will return null. If you'd prefer an exception be thrown, you may use the findOrFail method:



Start by making an instance of a taxonomy with the make method. You can pass the handle into it.

$taxonomy = Taxonomy::make('tags');

You may call additional methods on the taxonomy to customize it further.

->cascade($data) // an array
->defaultPublishState('published') // or 'draft'
->sites(['one', 'two']) // array of handles

Finally, save it.

HR: Section
Learn More!

There is more to learn more in these related articles:


HR: Section
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →