class DataConfig

Properties

non-empty-list<string> $dateFormats

The accepted date formats in declaration order.

string|null $dateTimezone

The timezone applied while casting and transforming dates.

ValidationStrategy $validationStrategy

The default validation strategy.

null|NameMapper> $inputNameMapper

The default input name mapper.

null|NameMapper> $outputNameMapper

The default output name mapper.

Cast>> $casts

The configured cast overrides.

Transformer>> $transformers

The configured transformer overrides.

Normalizer>> $normalizers

The configured global normalizers.

string|null $wrap

The default resource wrapper.

int|null $maxTransformationDepth

The maximum nested transformation depth.

protected BaseData>> $morphMap
protected BaseData>, string> $reversedMorphMap

Methods

__construct(Repository $config)

Create a new data configuration.

void
enforceMorphMap(array $map)

Register the enforced data morph map.

string|null
getMorphedDataClass(string $alias)

Get the data class registered for a morph alias.

string|null
getDataClassAlias(string $class)

Get the morph alias registered for a data class.

Details

at line 89
__construct(Repository $config)

Create a new data configuration.

Parameters

Repository $config

at line 122
void enforceMorphMap(array $map)

Register the enforced data morph map.

Boot-only. The aliases persist on the worker-lifetime configuration and affect every subsequent data cast in the worker.

Parameters

array $map

Return Value

void

at line 169
string|null getMorphedDataClass(string $alias)

Get the data class registered for a morph alias.

Parameters

string $alias

Return Value

string|null

at line 179
string|null getDataClassAlias(string $class)

Get the morph alias registered for a data class.

Parameters

string $class

Return Value

string|null