Comment
class Comment extends Model (View source)
Traits
Methods to give a model a formatted text body
.
Methods to manage reactions on a model.
Methods for models that have validation rules.
Trait for models that notifications can be about.
Constants
UPDATED_AT |
|
Properties
static protected | $unguarded | from Model | |
static protected Formatter[] | $formatters | from UsesFormatter | |
string | $body | ||
string | $parsed_body | The intermediary parsed XML document. |
from HasBody |
HtmlString read-only | $body_html | The formatted HTML version of the body for the current user. |
from HasBody |
string read-only | $body_text | The parsed body with formatting removed. |
from HasBody |
Collection read-only | $mentions | from HasBody | |
Collection read-only | $attachments | from HasBody | |
protected | $casts | ||
$hidden | |||
int | $id | ||
int | $post_id | ||
null|int | $parent_id | ||
null|int | $user_id | ||
Carbon | $created_at | ||
null|Carbon | $edited_at | ||
int | $reply_count | ||
int | $score | ||
$hidden_at | |||
$hidden_by | |||
$hidden_reason | |||
Post read-only | $post | ||
null|User read-only | $user | ||
Collection read-only | $replies | ||
null|Comment read-only | $parent | ||
$hiddenBy | |||
string read-only | $url | ||
string read-only | $edit_url | ||
string read-only | $post_url |
Methods
Set a formatter instance for this model.
Relationship with the uploads that were attached in the body.
Relationship with a summary of the reactions for this model.
No description
Validate an array of data against the model's validation rules.
The model's validation custom attribute translations.
Relationship with the notifications about this model.
Relationship with the notifications grouped by this model.
No description
No description
No description
No description
No description
No description
Determine whether this comment is unread by the current user.
Determine whether this comment is read by the current user.
Determine whether this comment has been marked as the answer.
Determine whether this comment has been hidden.
Mark this comment as having been edited just now.
Refresh the metadata about this comment's replies.
No description
Get the Turbo Streams that should be sent when this comment is updated.
Get the Turbo Streams that should be sent when this comment is removed.
No description
No description
No description
Details
in
Model at line 18
getConnectionName()
No description
HtmlString|string
format(string $attribute, User $user = null)
Render an attribute as HTML for the given user.
static Formatter
getFormatter(string $attribute)
Set a formatter instance for this model.
static void
setFormatter(string $attribute, Formatter $formatter)
Set a formatter instance for this model.
getAttribute($key)
No description
setAttribute($key, $value)
No description
static void
bootHasBody()
No description
MorphToMany
mentions()
Relationship with the users who were mentioned in the body.
MorphToMany
attachments()
Relationship with the uploads that were attached in the body.
MorphMany
reactions()
Relationship with the reactions for this model.
ReactionsSummaryRelation
reactionsSummary()
Relationship with a summary of the reactions for this model.
This is less expensive to load than all of the actual reactions.
ReactionSet|null
reactionSet()
No description
Reactable
recalculateScore()
Recalculate the score from the reactions.
static array
validate(array $data, ValidatesData $instance = null)
Validate an array of data against the model's validation rules.
static array
rules(Comment $instance = null)
No description
static protected array
messages(ValidatesData $instance = null)
The model's validation messages.
static protected array
customAttributes(ValidatesData $instance = null)
The model's validation custom attribute translations.
static void
bootNotificationContent()
No description
MorphMany
notifications()
Relationship with the notifications about this model.
MorphMany
groupedNotifications()
Relationship with the notifications grouped by this model.
static protected void
booted()
No description
BelongsTo
post()
No description
BelongsTo
user()
No description
HasMany
replies()
No description
BelongsTo
parent()
No description
BelongsTo
hiddenBy()
No description
bool
isUnread()
Determine whether this comment is unread by the current user.
bool
isRead()
Determine whether this comment is read by the current user.
bool
isAnswer()
Determine whether this comment has been marked as the answer.
bool
isHidden()
Determine whether this comment has been hidden.
Comment
markAsEdited()
Mark this comment as having been edited just now.
Comment
refreshReplyMetadata()
Refresh the metadata about this comment's replies.
int
getPerPage()
No description
array
streamUpdated()
Get the Turbo Streams that should be sent when this comment is updated.
array
streamRemoved()
Get the Turbo Streams that should be sent when this comment is removed.
protected Attribute
url()
No description
protected Attribute
editUrl()
No description
protected Attribute
postUrl()
No description
string
reactionsUrl(ReactionType $reactionType)
No description