BrandSetting

Brand settings that affect all users

 class Backend\Models\BrandSetting
extends Model

Traits

Trait Description
Validation
ViewMaker

View Maker Trait Adds view based methods to a class

Constants

Constant Description
ACCENT_COLOR
string "#3498db"
COLLAPSE_MENU
string "collapse"
INLINE_MENU
string "inline"
PRIMARY_COLOR
string "#34495e"
SECONDARY_COLOR
string "#e67e22"
TILE_MENU
string "tile"

Properties

public $attachOne : mixed

public $cacheKey : string

The key to store rendered CSS in the cache under

public $implement : array

Behaviors implemented by this model.

public $rules : mixed

Validation rules

public $settingsCode : string

Unique code

public $settingsFields : mixed

Settings form field definitions

public $layout : string

Inherited from ViewMaker

Layout to use for the view.

public $suppressLayout : bool

Inherited from ViewMaker

Prevents the use of a layout.

public $vars : array

Inherited from ViewMaker

A list of variables to pass to the page.

protected $layoutPath : string

Inherited from ViewMaker

Specifies a path to the layout directory.

protected $validationDefaultAttrNames : array

Inherited from Validation

Default custom attribute names.

protected $validationErrors : Illuminate\Support\MessageBag

Inherited from Validation

The message bag instance containing validation error messages

protected $viewPath : string | array

Inherited from ViewMaker

Specifies a path to the views directory.

Methods

public afterSave ()

Returns
mixed

public static compileCss ()

Returns
mixed

public static getDefaultFavicon ()

Returns
mixed

public static getDefaultLogo ()

Returns
mixed

public static getFavicon ()

Returns
mixed

public static getLogo ()

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

public static isBaseConfigured ()

Returns
mixed

public static renderCss ()

Returns
mixed

public addViewPath (string | array $path) : void

Inherited from ViewMaker

Prepends a path on the available view path locations.

Parameters
Property Description
$path
string | array
Returns
void

public static bootValidation () : void

Inherited from Validation

Boot the validation trait for this model.

Returns
void

public errors () : Illuminate\Support\MessageBag

Inherited from Validation

Get validation error message collection for the Model

Returns
Illuminate\Support\MessageBag

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

public getViewPath (string $fileName, $viewPaths = null) : string

Inherited from ViewMaker

Locates a file based on its definition. The file name can be prefixed with a symbol (~|$) to return in context of the application or plugin base path, otherwise it will be returned in context of this object view path.

If the fileName cannot be found it will be returned unmodified.

Parameters
Property Description
$fileName
string
$viewPaths
mixed
Returns
string

public getViewPaths () : array

Inherited from ViewMaker

Returns the active view path locations.

Returns
array

public guessViewPath (string $suffix = "", boolean $isPublic = false) : string | null

Inherited from ViewMaker

Guess the package path for the called class.

Parameters
Property Description
$suffix
string

An extra path to attach to the end

$isPublic
boolean

Returns public path instead of an absolute one

Returns
string | null

public guessViewPathFrom (string $class, string $suffix = "", boolean $isPublic = false) : string | null

Inherited from ViewMaker

Guess the package path from a specified class.

Parameters
Property Description
$class
string

Class to guess path from.

$suffix
string

An extra path to attach to the end

$isPublic
boolean

Returns public path instead of an absolute one

Returns
string | null

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

public makeFileContents (string $filePath, array $extraParams = []) : string

Inherited from ViewMaker

Includes a file path using output buffering, making the provided vars available.

Parameters
Property Description
$filePath
string
$extraParams
array
Returns
string

public makeLayout ($name = null, array $params = [], boolean $throwException = true) : string | bool

Inherited from ViewMaker

Render a layout, defaulting to the layout propery specified on the class

Parameters
Property Description
$name
mixed
$params
array
$throwException
boolean
Returns
string | bool

The layout contents, or false.

public makeLayoutPartial (string $partial, array $params = []) : string

Inherited from ViewMaker

Renders a layout partial

Parameters
Property Description
$partial
string
$params
array
Returns
string

public makePartial (string $partial, array $params = [], boolean $throwException = true) : mixed

Inherited from ViewMaker

Render a partial file contents located in the views folder.

Parameters
Property Description
$partial
string
$params
array
$throwException
boolean
Returns
mixed

Partial contents or false if not throwing an exception.

public makeView (string $view) : string

Inherited from ViewMaker

Loads the specified view. Applies the layout if one is set.

The view file must have the .php extension (or ".htm" for historical reasons) and be located in the views directory

Parameters
Property Description
$view
string
Returns
string

public makeViewContent (string $contents, $layout = null) : string

Inherited from ViewMaker

Renders supplied contents inside a layout.

Parameters
Property Description
$contents
string
$layout
mixed
Returns
string

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

public setValidationAttributeNames (array $attributeNames) : void

Inherited from Validation

Programatically sets multiple validation attribute names.

Parameters
Property Description
$attributeNames
array
Returns
void

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

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

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

protected getRelationValidationValue ($relationName)

Inherited from Validation

Attachments validate differently to their simple values.

Parameters
Property Description
$relationName
mixed
Returns
mixed

protected getValidationAttributes () : array

Inherited from Validation

Returns the model data used for validation.

Returns
array

protected handleViewException (Throwable $e, integer $obLevel) : void

Inherited from ViewMaker

Handle a view exception.

Parameters
Property Description
$e
Throwable
$obLevel
integer
Returns
void

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

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

protected processValidationRules ($rules)

Inherited from Validation

Process rules

Parameters
Property Description
$rules
mixed
Returns
mixed

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