W3cubDocs

/Laravel 8

ValidationData

class ValidationData (View source)

Methods

static array initializeAndGatherData(string $attribute, array $masterData)

Initialize and gather data for given attribute.

static array initializeAttributeOnData(string $attribute, array $masterData)

Gather a copy of the attribute data filled with any missing attributes.

static array extractValuesForWildcards(array $masterData, array $data, string $attribute)

Get all of the exact attribute values for a given wildcard attribute.

static array extractDataFromPath(string $attribute, array $masterData)

Extract data based on the given dot-notated path.

static string getLeadingExplicitAttributePath(string $attribute)

Get the explicit part of the attribute name.

Details

static array initializeAndGatherData(string $attribute, array $masterData)

Initialize and gather data for given attribute.

Parameters

string $attribute
array $masterData

Return Value

array

static protected array initializeAttributeOnData(string $attribute, array $masterData)

Gather a copy of the attribute data filled with any missing attributes.

Parameters

string $attribute
array $masterData

Return Value

array

static protected array extractValuesForWildcards(array $masterData, array $data, string $attribute)

Get all of the exact attribute values for a given wildcard attribute.

Parameters

array $masterData
array $data
string $attribute

Return Value

array

static array extractDataFromPath(string $attribute, array $masterData)

Extract data based on the given dot-notated path.

Used to extract a sub-section of the data for faster iteration.

Parameters

string $attribute
array $masterData

Return Value

array

static string getLeadingExplicitAttributePath(string $attribute)

Get the explicit part of the attribute name.

E.g. 'foo.bar.*.baz' -> 'foo.bar'

Allows us to not spin through all of the flattened data for some operations.

Parameters

string $attribute

Return Value

string

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Validation/ValidationData.html