class DiscussionRenamedPost extends AbstractEventPost implements MergeableInterface
A post which indicates that a discussion's title was changed.
The content is stored as a sequential array containing the old title and the new title.
Traits
Properties
bool | $timestamps | <p>Indicates if the model should be timestamped. Turn off by default.</p> | from AbstractModel | |
protected callable[] | $afterSaveCallbacks | <p>An array of callbacks to be run once after the model is saved.</p> | from AbstractModel | |
protected callable[] | $afterDeleteCallbacks | <p>An array of callbacks to be run once after the model is deleted.</p> | from AbstractModel | |
static | $customRelations | from AbstractModel | ||
static | $customCasts | from AbstractModel | ||
static | $defaults | from AbstractModel | ||
protected | $tableAlias | <p>An alias for the table name, used in queries.</p> | from AbstractModel | |
protected | $pendingEvents | from EventGeneratorTrait | ||
static protected | $visibilityScopers | from ScopeVisibilityTrait | ||
protected | $table | from Post | ||
protected | $casts | from Post | ||
static protected Post>> | $models | <p>A map of post types, as specified in the <code>type</code> column, to their classes.</p> | from Post | |
static | $type | |||
int | $id | from Post | ||
int | $discussion_id | from Post | ||
int|Expression | $number | from Post | ||
Carbon | $created_at | from Post | ||
int|null | $user_id | from Post | ||
array | $content | from AbstractEventPost | ||
Carbon|null | $edited_at | from Post | ||
int|null | $edited_user_id | from Post | ||
$hidden_at | from Post | |||
$hidden_user_id | from Post | |||
string | $ip_address | from Post | ||
bool | $is_private | from Post | ||
Discussion|null | $discussion | from Post | ||
User|null | $user | from Post | ||
User|null | $editedUser | from Post | ||
$hiddenUser | from Post |
Methods
<p>Get an attribute from the model. If nothing is found, attempt to load a custom relation method with this key.</p>
<p>Register a callback to be run once after the model is saved.</p>
<p>Register a callback to be run once after the model is deleted.</p>
No description
<p>Scope a query to only include records that are visible to a user.</p>
<p>Get all posts, regardless of their type, by removing the <code>RegisteredTypesScope</code> global scope constraints applied on this model.</p>
<p>Create a new model instance according to the post's type.</p>
<p>Unserialize the content attribute from the database's JSON value.</p>
<p>Serialize the content attribute to be stored in the database as JSON.</p>
No description
Details
in AbstractModel
at
line 88
__construct(array $attributes = [])
in AbstractModel
at
line 103
array
getCasts()
in AbstractModel
at
line 118
getAttribute($key)
<p>Get an attribute from the model. If nothing is found, attempt to load a custom relation method with this key.</p>
in AbstractModel
at
line 143
protected mixed
getCustomRelation(string $name)
<p>Get a custom relation object.</p>
in AbstractModel
at
line 158
void
afterSave(callable $callback)
<p>Register a callback to be run once after the model is saved.</p>
in AbstractModel
at
line 166
void
afterDelete(callable $callback)
<p>Register a callback to be run once after the model is deleted.</p>
in AbstractModel
at
line 174
array
releaseAfterSaveCallbacks()
in AbstractModel
at
line 186
array
releaseAfterDeleteCallbacks()
in AbstractModel
at
line 195
__call($method, $parameters)
in AbstractModel
at
line 204
newModelQuery()
in AbstractModel
at
line 215
qualifyColumn($column)
in AbstractModel
at
line 224
mixed
withTableAlias(callable $callback)
in AbstractModel
at
line 236
Collection
newCollection(array $models = [])
in AbstractModel
at
line 241
__sleep()
in EventGeneratorTrait
at
line 16
void
raise(object $event)
in EventGeneratorTrait
at
line 24
array
releaseEvents()
<p>Return and reset all pending events.</p>
in ScopeVisibilityTrait
at
line 28
static void
registerVisibilityScoper(callable $scoper, string|null $ability = null)
in ScopeVisibilityTrait
at
line 44
Builder
scopeWhereVisibleTo(Builder $query, User $actor, string $ability = 'view')
<p>Scope a query to only include records that are visible to a user.</p>
in ScopeVisibilityTrait
at
line 19
static Builder
whereVisibleTo(User $user)
bool
isVisibleTo(User $user)
<p>Determine whether this post is visible to the given user.</p>
Builder
scopeAllTypes(Builder $query)
<p>Get all posts, regardless of their type, by removing the <code>RegisteredTypesScope</code> global scope constraints applied on this model.</p>
Post|object
newFromBuilder(array $attributes = [], string|null $connection = null)
<p>Create a new model instance according to the post's type.</p>
in AbstractEventPost
at
line 20
array|null
getContentAttribute(string $value)
<p>Unserialize the content attribute from the database's JSON value.</p>
in AbstractEventPost
at
line 28
void
setContentAttribute(mixed $value)
<p>Serialize the content attribute to be stored in the database as JSON.</p>
at
line 24
MergeableInterface
saveAfter(Post $previous = null)
<p>Save the model, given that it is going to appear immediately after the passed model.</p>