abstract class AbstractEventPost extends Post
Traits
Properties
| bool | $timestamps | Indicates if the model should be timestamped. Turn off by default. | from AbstractModel |
|
| protected callable[] | $afterSaveCallbacks | An array of callbacks to be run once after the model is saved. | from AbstractModel |
|
| protected callable[] | $afterDeleteCallbacks | An array of callbacks to be run once after the model is deleted. | from AbstractModel |
|
| static array | $customCasts | from AbstractModel |
|
|
| static array | $defaults | from AbstractModel |
|
|
| protected string|null | $tableAlias | An alias for the table name, used in queries. | from AbstractModel |
|
| string[]|null | $uniqueKeys | If a model has unique keys, they should be defined here. | from AbstractModel |
|
| protected array | $pendingEvents | from EventGeneratorTrait |
|
|
| static protected array | $visibilityScopers | from ScopeVisibilityTrait |
|
|
| protected | $table | from Post |
|
|
| protected | $casts | from Post |
|
|
| static protected Post>> | $models | A map of post types, as specified in the `type` column, to their classes. | from Post |
|
| string|null | $type | from Post |
|
|
| 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 |
|
||
| 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
Register a callback to be run once after the model is saved.
Register a callback to be run once after the model is deleted.
No description
Scope a query to only include records that are visible to a user.
Get all posts, regardless of their type, by removing the `RegisteredTypesScope` global scope constraints applied on this model.
Create a new model instance according to the post's type.
Unserialize the content attribute from the database's JSON value.
Serialize the content attribute to be stored in the database as JSON.
Details
in AbstractModel
at
line 88
__construct(array $attributes = [])
in AbstractModel
at
line 103
array
getCasts()
in AbstractModel
at
line 117
void
afterSave(callable $callback)
Register a callback to be run once after the model is saved.
in AbstractModel
at
line 125
void
afterDelete(callable $callback)
Register a callback to be run once after the model is deleted.
in AbstractModel
at
line 133
array
releaseAfterSaveCallbacks()
in AbstractModel
at
line 145
array
releaseAfterDeleteCallbacks()
in AbstractModel
at
line 157
newModelQuery()
in AbstractModel
at
line 169
qualifyColumn($column)
in AbstractModel
at
line 178
mixed
withTableAlias(callable $callback)
in AbstractModel
at
line 191
Collection
newCollection(array $models = [])
in AbstractModel
at
line 197
__sleep()
in EventGeneratorTrait
at
line 16
void
raise(object $event)
in EventGeneratorTrait
at
line 24
array
releaseEvents()
Return and reset all pending events.
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')
Scope a query to only include records that are visible to a user.
in ScopeVisibilityTrait
at
line 19
static Builder
whereVisibleTo(User $user)
bool
isVisibleTo(User $user)
Determine whether this post is visible to the given user.
Builder
scopeAllTypes(Builder $query)
Get all posts, regardless of their type, by removing the `RegisteredTypesScope` global scope constraints applied on this model.
Post|object
newFromBuilder(array $attributes = [], string|null $connection = null)
Create a new model instance according to the post's type.
at
line 20
array|null
getContentAttribute(string $value)
Unserialize the content attribute from the database's JSON value.
at
line 28
void
setContentAttribute(mixed $value)
Serialize the content attribute to be stored in the database as JSON.