trait ValidatesData (View source)

Methods for models that have validation rules.

Methods

static array
validate(array $data, ValidatesData $instance = null)

Validate an array of data against the model's validation rules.

static array
rules(ValidatesData $instance = null)

The model's validation rules.

static array
messages(ValidatesData $instance = null)

The model's validation messages.

static array
customAttributes(ValidatesData $instance = null)

The model's validation custom attribute translations.

Details

static array validate(array $data, ValidatesData $instance = null)

Validate an array of data against the model's validation rules.

Parameters

array $data
ValidatesData $instance

Return Value

array

static protected array rules(ValidatesData $instance = null)

The model's validation rules.

Parameters

ValidatesData $instance

Return Value

array

static protected array messages(ValidatesData $instance = null)

The model's validation messages.

Parameters

ValidatesData $instance

Return Value

array

static protected array customAttributes(ValidatesData $instance = null)

The model's validation custom attribute translations.

Parameters

ValidatesData $instance

Return Value

array