Publishable
trait Publishable (View source)
Methods
Boot the has-drafts trait for a model.
Initialize this trait for an instance.
Save instance of this model as published.
Toogle model instance state to non-published.
Save instance of this model as a draft.
Register a "publishing" model event callback with the dispatcher.
Register a "unpublishing" model event callback with the dispatcher.
Register a "unpublished" model event callback with the dispatcher.
Determine if the model instance is published.
Get the name of the "published at" column.
Get the fully qualified "published at" column.
Details
at line 17
static void
bootPublishable()
Boot the has-drafts trait for a model.
at line 27
void
initializePublishable()
Initialize this trait for an instance.
at line 39
bool
publish(array $options = [])
Save instance of this model as published.
at line 70
bool
unpublish(array $options = [])
Toogle model instance state to non-published.
at line 94
bool
draft(array $options = [])
Save instance of this model as a draft.
at line 106
static void
publishing(Closure|string $callback)
Register a "publishing" model event callback with the dispatcher.
at line 118
static void
published(Closure|string $callback)
Register a "published" model event callback with the dispatcher.
at line 130
static void
unpublishing(Closure|string $callback)
Register a "unpublishing" model event callback with the dispatcher.
at line 142
static void
unpublished(Closure|string $callback)
Register a "unpublished" model event callback with the dispatcher.
at line 152
bool
isPublished()
Determine if the model instance is published.
at line 162
string
getPublishedAtColumn()
Get the name of the "published at" column.
at line 172
string
getQualifiedPublishedAtColumn()
Get the fully qualified "published at" column.