EntryFactory

Statamic\Data\Entries\EntryFactory


Inheritance: ContentFactory

Usage

Create a EntryFactory using the API class. You should pass the slug into the create method.

$factory = Statamic\API\Entry::create('my-post');

Available Methods

collection

Specify the collection, as a string.

$factory->collection('blog');

date

An alias for setting the order as a date string, with the benefit of using Carbon to parse the provided string. Not providing an argument will use the current date.

$factory->date('2016-01-01');

$factory->date('1 week ago');

$factory->date(); // now

Import using:

use Statamic\Data\Entries\EntryFactory