Documentation

Message extends Model
in package
Uses Validation

Vdomah\Telegram\Models\Message

Tags
mixin

\Eloquent

Table of Contents

$audio  : string|null
$belongsTo  : mixed
$caption  : string|null
$channel_chat_created  : int
$chat_id  : int
$contact  : string|null
$date  : string|null
$delete_chat_photo  : int
$document  : string|null
$entities  : string|null
$forward_date  : string|null
$forward_from  : int|null
$forward_from_chat  : int|null
$group_chat_created  : int
$id  : int
$left_chat_member  : int|null
$location  : string|null
$migrate_from_chat_id  : int|null
$migrate_to_chat_id  : int|null
$new_chat_member  : int|null
$new_chat_photo  : string|null
$new_chat_title  : string|null
$photo  : string|null
$pinned_message  : string|null
$reply_to_chat  : int|null
$reply_to_message  : int|null
$rules  : mixed
$sticker  : string|null
$supergroup_chat_created  : int
$table  : string
$text  : string|null
$timestamps  : mixed
$user_id  : int|null
$venue  : string|null
$video  : string|null
$voice  : string|null
$validationDefaultAttrNames  : array<string|int, mixed>
$validationErrors  : MessageBag
all()  :
bootValidation()  : void
Boot the validation trait for this model.
errors()  : MessageBag
Get validation error message collection for the Model
forceSave()  : bool
Force save the model even if validation fails.
get()  :
isAttributeRequired()  : bool
Determines if an attribute is required based on the validation rules.
newModelQuery()  :
newQuery()  :
query()  :
setValidationAttributeName()  : void
Programatically sets the validation attribute names, will take lower priority to model defined attribute names found in `$attributeNames`.
setValidationAttributeNames()  : void
Programatically sets multiple validation attribute names.
validate()  : bool
Validate the model instance
validated()  : void
Create a new native event for handling afterValidate().
validating()  : void
Create a new native event for handling beforeValidate().
whereAudio()  :
whereCaption()  :
whereChannelChatCreated()  :
whereChatId()  :
whereContact()  :
whereDate()  :
whereDeleteChatPhoto()  :
whereDocument()  :
whereEntities()  :
whereForwardDate()  :
whereForwardFrom()  :
whereForwardFromChat()  :
whereGroupChatCreated()  :
whereId()  :
whereLeftChatMember()  :
whereLocation()  :
whereMigrateFromChatId()  :
whereMigrateToChatId()  :
whereNewChatMember()  :
whereNewChatPhoto()  :
whereNewChatTitle()  :
wherePhoto()  :
wherePinnedMessage()  :
whereReplyToChat()  :
whereReplyToMessage()  :
whereSticker()  :
whereSupergroupChatCreated()  :
whereText()  :
whereUserId()  :
whereVenue()  :
whereVideo()  :
whereVoice()  :
getRelationValidationValue()  : mixed
Attachments validate differently to their simple values.
getValidationAttributes()  : array<string|int, mixed>
Returns the model data used for validation.
makeValidator()  : Validator
Instantiates the validator used by the validation process, depending if the class is being used inside or outside of Laravel. Optional connection string to make the validator use a different database connection than the default connection.
processRuleFieldNames()  : array<string|int, mixed>
Processes field names in a rule array.
processValidationRules()  : mixed
Process rules
processValidationUniqueRule()  : string
Rebuilds the unique validation rule to force for the existing ID

Properties

$belongsTo

public mixed $belongsTo = ['user' => ['Vdomah\Telegram\Models\User'], 'chat' => ['Vdomah\Telegram\Models\Chat']]

$channel_chat_created

public int $channel_chat_created

$delete_chat_photo

public int $delete_chat_photo

$document

public string|null $document

$entities

public string|null $entities

$forward_date

public string|null $forward_date

$forward_from

public int|null $forward_from

$forward_from_chat

public int|null $forward_from_chat

$group_chat_created

public int $group_chat_created

$left_chat_member

public int|null $left_chat_member

$location

public string|null $location

$migrate_from_chat_id

public int|null $migrate_from_chat_id

$migrate_to_chat_id

public int|null $migrate_to_chat_id

$new_chat_member

public int|null $new_chat_member

$new_chat_photo

public string|null $new_chat_photo

$new_chat_title

public string|null $new_chat_title

$pinned_message

public string|null $pinned_message

$reply_to_chat

public int|null $reply_to_chat

$reply_to_message

public int|null $reply_to_message

$supergroup_chat_created

public int $supergroup_chat_created

$table

public string $table = 'vdomah_telegram_message'

The database table used by the model.

$timestamps

public mixed $timestamps = false

$validationDefaultAttrNames

protected array<string|int, mixed> $validationDefaultAttrNames = []

Default custom attribute names.

$validationErrors

protected MessageBag $validationErrors

The message bag instance containing validation error messages

Methods

all()

public static all(mixed $columns) :
Parameters
$columns : mixed
Return values
—

bootValidation()

Boot the validation trait for this model.

public static bootValidation() : void
Return values
void —

forceSave()

Force save the model even if validation fails.

public forceSave([mixed $options = null ][, mixed $sessionKey = null ]) : bool
Parameters
$options : mixed = null
$sessionKey : mixed = null
Return values
bool —

get()

public static get(mixed $columns) :
Parameters
$columns : mixed
Return values
—

isAttributeRequired()

Determines if an attribute is required based on the validation rules.

public isAttributeRequired(string $attribute[, bool $checkDependencies = true ]) : bool
Parameters
$attribute : string
$checkDependencies : bool = true

Checks the attribute dependencies (for required_if & required_with rules). Note that it will only be checked up to the next level, if another dependent rule is found then it will just assume the field is required

Return values
bool —

newModelQuery()

public static newModelQuery() :
Return values
—

newQuery()

public static newQuery() :
Return values
—

query()

public static query() :
Return values
—

setValidationAttributeName()

Programatically sets the validation attribute names, will take lower priority to model defined attribute names found in `$attributeNames`.

public setValidationAttributeName(string $attr, string $name) : void
Parameters
$attr : string
$name : string
Return values
void —

setValidationAttributeNames()

Programatically sets multiple validation attribute names.

public setValidationAttributeNames(array<string|int, mixed> $attributeNames) : void
Parameters
$attributeNames : array<string|int, mixed>
Return values
void —

validate()

Validate the model instance

public validate([mixed $rules = null ][, mixed $customMessages = null ][, mixed $attributeNames = null ]) : bool
Parameters
$rules : mixed = null
$customMessages : mixed = null
$attributeNames : mixed = null
Return values
bool —

validated()

Create a new native event for handling afterValidate().

public static validated(Closure|string $callback) : void
Parameters
$callback : Closure|string
Return values
void —

validating()

Create a new native event for handling beforeValidate().

public static validating(Closure|string $callback) : void
Parameters
$callback : Closure|string
Return values
void —

whereAudio()

public static whereAudio(mixed $value) :
Parameters
$value : mixed
Return values
—

whereCaption()

public static whereCaption(mixed $value) :
Parameters
$value : mixed
Return values
—

whereChannelChatCreated()

public static whereChannelChatCreated(mixed $value) :
Parameters
$value : mixed
Return values
—

whereChatId()

public static whereChatId(mixed $value) :
Parameters
$value : mixed
Return values
—

whereContact()

public static whereContact(mixed $value) :
Parameters
$value : mixed
Return values
—

whereDate()

public static whereDate(mixed $value) :
Parameters
$value : mixed
Return values
—

whereDeleteChatPhoto()

public static whereDeleteChatPhoto(mixed $value) :
Parameters
$value : mixed
Return values
—

whereDocument()

public static whereDocument(mixed $value) :
Parameters
$value : mixed
Return values
—

whereEntities()

public static whereEntities(mixed $value) :
Parameters
$value : mixed
Return values
—

whereForwardDate()

public static whereForwardDate(mixed $value) :
Parameters
$value : mixed
Return values
—

whereForwardFrom()

public static whereForwardFrom(mixed $value) :
Parameters
$value : mixed
Return values
—

whereForwardFromChat()

public static whereForwardFromChat(mixed $value) :
Parameters
$value : mixed
Return values
—

whereGroupChatCreated()

public static whereGroupChatCreated(mixed $value) :
Parameters
$value : mixed
Return values
—

whereId()

public static whereId(mixed $value) :
Parameters
$value : mixed
Return values
—

whereLeftChatMember()

public static whereLeftChatMember(mixed $value) :
Parameters
$value : mixed
Return values
—

whereLocation()

public static whereLocation(mixed $value) :
Parameters
$value : mixed
Return values
—

whereMigrateFromChatId()

public static whereMigrateFromChatId(mixed $value) :
Parameters
$value : mixed
Return values
—

whereMigrateToChatId()

public static whereMigrateToChatId(mixed $value) :
Parameters
$value : mixed
Return values
—

whereNewChatMember()

public static whereNewChatMember(mixed $value) :
Parameters
$value : mixed
Return values
—

whereNewChatPhoto()

public static whereNewChatPhoto(mixed $value) :
Parameters
$value : mixed
Return values
—

whereNewChatTitle()

public static whereNewChatTitle(mixed $value) :
Parameters
$value : mixed
Return values
—

wherePhoto()

public static wherePhoto(mixed $value) :
Parameters
$value : mixed
Return values
—

wherePinnedMessage()

public static wherePinnedMessage(mixed $value) :
Parameters
$value : mixed
Return values
—

whereReplyToChat()

public static whereReplyToChat(mixed $value) :
Parameters
$value : mixed
Return values
—

whereReplyToMessage()

public static whereReplyToMessage(mixed $value) :
Parameters
$value : mixed
Return values
—

whereSticker()

public static whereSticker(mixed $value) :
Parameters
$value : mixed
Return values
—

whereSupergroupChatCreated()

public static whereSupergroupChatCreated(mixed $value) :
Parameters
$value : mixed
Return values
—

whereText()

public static whereText(mixed $value) :
Parameters
$value : mixed
Return values
—

whereUserId()

public static whereUserId(mixed $value) :
Parameters
$value : mixed
Return values
—

whereVenue()

public static whereVenue(mixed $value) :
Parameters
$value : mixed
Return values
—

whereVideo()

public static whereVideo(mixed $value) :
Parameters
$value : mixed
Return values
—

whereVoice()

public static whereVoice(mixed $value) :
Parameters
$value : mixed
Return values
—

getRelationValidationValue()

Attachments validate differently to their simple values.

protected getRelationValidationValue(mixed $relationName) : mixed
Parameters
$relationName : mixed
Return values
mixed —

getValidationAttributes()

Returns the model data used for validation.

protected getValidationAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed> —

makeValidator()

Instantiates the validator used by the validation process, depending if the class is being used inside or outside of Laravel. Optional connection string to make the validator use a different database connection than the default connection.

protected static makeValidator(mixed $data, mixed $rules, mixed $customMessages, mixed $attributeNames[, mixed $connection = null ]) : Validator
Parameters
$data : mixed
$rules : mixed
$customMessages : mixed
$attributeNames : mixed
$connection : mixed = null
Return values
Validator —

processRuleFieldNames()

Processes field names in a rule array.

protected processRuleFieldNames(array<string|int, mixed> $rules) : array<string|int, mixed>

Converts any field names using array notation (ie. field[child]) into dot notation (ie. field.child)

Parameters
$rules : array<string|int, mixed>

Rules array

Return values
array<string|int, mixed> —

processValidationRules()

Process rules

protected processValidationRules(mixed $rules) : mixed
Parameters
$rules : mixed
Return values
mixed —

processValidationUniqueRule()

Rebuilds the unique validation rule to force for the existing ID

protected processValidationUniqueRule(string $definition, string $fieldName) : string
Parameters
$definition : string
$fieldName : string
Return values
string —

Search results