Collection
Statamic\API\Collection
A collection in this context is a container of entries.
Not to be confused with Illuminate\Support\Collection
. Although that’s awesome, too. Check it out.
Get all collections.
Collection::all(); // Returns \Illuminate\Support\Collection
Get the handles of all collections.
Collection::handles(); // Returns an array of strings
Get a collection by handle.
Collection::whereHandle($handle); // Returns Collection
Check if a collection exists.
Collection::handleExists($handle); // Returns a boolean
Create a collection.
Collection::create($handle); // Returns Collection
Import using:
use Statamic\API\Collection