MailSetting

Mail settings

 class System\Models\MailSetting
extends Model

Extends

Class Description
Model

Traits

Trait Description
Validation

Constants

Constant Description
MODE_LOG
string "log"
MODE_MAIL
string "mail"
MODE_SENDMAIL
string "sendmail"
MODE_SMTP
string "smtp"

Properties

public $implement : array

Behaviors implemented by this model.

public $rules : mixed

public $settingsCode : string

Unique code

public $settingsFields : mixed

Settings form field defitions

inherited protected $validationDefaultAttrNames : array

Inherited from Validation

Default custom attribute names.

inherited protected $validationErrors : Illuminate\Support\MessageBag

Inherited from Validation

The message bag instance containing validation error messages

Methods

public static applyConfigValues ()

Returns
mixed

public filterFields (array $fields, string | null $context = null) : void

Filter fields callback.

We use this to show smtp credential fields only for smtp mode and when smtp authorization is required.

Parameters
Property Description
$fields
array
$context
string | null
Returns
void

public getSendModeOptions ()

Returns
mixed

public initSettingsData () : void

Initialize the seed data for this model. This only executes when the model is first created or reset to default.

Returns
void

inherited public static bootValidation () : void

Inherited from Validation

Boot the validation trait for this model.

Returns
void

inherited public errors () : Illuminate\Support\MessageBag

Inherited from Validation

Get validation error message collection for the Model

Returns
Illuminate\Support\MessageBag

inherited public forceSave ($options = null, $sessionKey = null) : bool

Inherited from Validation

Force save the model even if validation fails.

Parameters
Property Description
$options
mixed
$sessionKey
mixed
Returns
bool

inherited public isAttributeRequired (string $attribute, boolean $checkDependencies = true) : bool

Inherited from Validation

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

Parameters
Property Description
$attribute
string
$checkDependencies
boolean

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

Returns
bool

inherited public setValidationAttributeName (string $attr, string $name) : void

Inherited from Validation

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

Parameters
Property Description
$attr
string
$name
string
Returns
void

inherited public setValidationAttributeNames (array $attributeNames) : void

Inherited from Validation

Programatically sets multiple validation attribute names.

Parameters
Property Description
$attributeNames
array
Returns
void

inherited public validate ($rules = null, $customMessages = null, $attributeNames = null) : bool

Inherited from Validation

Validate the model instance

Parameters
Property Description
$rules
mixed
$customMessages
mixed
$attributeNames
mixed
Returns
bool

inherited public static validated (Closure | string $callback) : void

Inherited from Validation

Create a new native event for handling afterValidate().

Parameters
Property Description
$callback
Closure | string
Returns
void

inherited public static validating (Closure | string $callback) : void

Inherited from Validation

Create a new native event for handling beforeValidate().

Parameters
Property Description
$callback
Closure | string
Returns
void

inherited protected getRelationValidationValue ($relationName)

Inherited from Validation

Attachments validate differently to their simple values.

Parameters
Property Description
$relationName
mixed
Returns
mixed

inherited protected getValidationAttributes () : array

Inherited from Validation

Returns the model data used for validation.

Returns
array

inherited protected static makeValidator ($data, $rules, $customMessages, $attributeNames, $connection = null) : Illuminate\Contracts\Validation\Validator

Inherited from Validation

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.

Parameters
Property Description
$data
mixed
$rules
mixed
$customMessages
mixed
$attributeNames
mixed
$connection
mixed
Returns
Illuminate\Contracts\Validation\Validator

inherited protected processRuleFieldNames (array $rules) : array

Inherited from Validation

Processes field names in a rule array.

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

Parameters
Property Description
$rules
array

Rules array

Returns
array

inherited protected processValidationRules ($rules)

Inherited from Validation

Process rules

Parameters
Property Description
$rules
mixed
Returns
mixed

inherited protected processValidationUniqueRule (string $definition, string $fieldName) : string

Inherited from Validation

Rebuilds the unique validation rule to force for the existing ID

Parameters
Property Description
$definition
string
$fieldName
string
Returns
string
Copyright © 2024 Winter CMS