trait Publishable (View source)

Methods

static void
bootPublishable()

Boot the has-drafts trait for a model.

void
initializePublishable()

Initialize this trait for an instance.

bool
publish(array $options = [])

Save instance of this model as published.

bool
unpublish(array $options = [])

Toogle model instance state to non-published.

bool
draft(array $options = [])

Save instance of this model as a draft.

static void
publishing(Closure|string $callback)

Register a "publishing" model event callback with the dispatcher.

static void
published(Closure|string $callback)

Register a "published" model event callback with the dispatcher.

static void
unpublishing(Closure|string $callback)

Register a "unpublishing" model event callback with the dispatcher.

static void
unpublished(Closure|string $callback)

Register a "unpublished" model event callback with the dispatcher.

bool
isPublished()

Determine if the model instance is published.

string
getPublishedAtColumn()

Get the name of the "published at" column.

string
getQualifiedPublishedAtColumn()

Get the fully qualified "published at" column.

Details

static void bootPublishable()

Boot the has-drafts trait for a model.

Return Value

void

void initializePublishable()

Initialize this trait for an instance.

Return Value

void

bool publish(array $options = [])

Save instance of this model as published.

Parameters

array $options

Return Value

bool

bool unpublish(array $options = [])

Toogle model instance state to non-published.

Parameters

array $options

Return Value

bool

bool draft(array $options = [])

Save instance of this model as a draft.

Parameters

array $options

Return Value

bool

static void publishing(Closure|string $callback)

Register a "publishing" model event callback with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

static void published(Closure|string $callback)

Register a "published" model event callback with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

static void unpublishing(Closure|string $callback)

Register a "unpublishing" model event callback with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

static void unpublished(Closure|string $callback)

Register a "unpublished" model event callback with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

bool isPublished()

Determine if the model instance is published.

Return Value

bool

string getPublishedAtColumn()

Get the name of the "published at" column.

Return Value

string

string getQualifiedPublishedAtColumn()

Get the fully qualified "published at" column.

Return Value

string