Entry
Statamic\API\Entry
Get all entries.
PHP
Entry::all(); // Returns EntryCollection
Get all entries in a collection
PHP
Entry::whereCollection($collection); // Returns EntryCollection
Get the number of entries in a collection
PHP
Entry::countWhereCollection($collection); // Returns an integer
This is significantly more performant than using Entry::whereCollection($collection)->count();
.
Get an entry by ID.
PHP
Entry::find($id); // Returns Entry
Get an entry by slug (and collection).
PHP
Entry::whereSlug($slug, $collection); // Returns Entry
Get an entry by URI.
PHP
Entry::whereUri($uri); // Returns Entry
Check if an entry exists.
PHP
Entry::exists($id); // Returns a boolean
Check if an entry exists by slug.
PHP
Entry::slugExists($slug, $collection); // Returns a boolean
Create an entry.
This returns an instance of a EntryFactory
to allow you to chain and build your entry.
PHP
Entry::create($slug); // Returns EntryFactory
Import using:
PHP
use Statamic\API\Entry