class CannotCastData extends Exception

Methods

static CannotCastData
shouldBeArray(string $modelClass, string $attribute)

Create an exception for a non-array cast value.

static CannotCastData
shouldBeData(string $modelClass, string $attribute)

Create an exception for a non-data cast value.

static CannotCastData
shouldBeTransformableData(string $modelClass, string $attribute)

Create an exception for a non-transformable data cast value.

static CannotCastData
dataClassMustBeTransformable(string $dataClass)

Create an exception for a non-transformable Eloquent data class.

static CannotCastData
shouldBeDataClass(string $modelClass, string $attribute, string $dataClass)

Create an exception for a data value of the wrong class.

static CannotCastData
invalidStoredValue(string $modelClass, string $attribute)

Create an exception for an invalid stored data representation.

static CannotCastData
invalidStoredCollectionItem(string $modelClass, string $attribute, int|string $itemKey)

Create an exception for an invalid stored collection item.

static CannotCastData
invalidMorphEnvelope(string $modelClass, string $attribute)

Create an exception for an invalid abstract data envelope.

static CannotCastData
invalidMorphClass(string $type, string $dataClass)

Create an exception for a stored data type that names no valid class.

static CannotCastData
dataCollectionTypeRequired()

Create an exception for a missing collection item type.

Details

at line 14
static CannotCastData shouldBeArray(string $modelClass, string $attribute)

Create an exception for a non-array cast value.

Parameters

string $modelClass
string $attribute

Return Value

CannotCastData

at line 22
static CannotCastData shouldBeData(string $modelClass, string $attribute)

Create an exception for a non-data cast value.

Parameters

string $modelClass
string $attribute

Return Value

CannotCastData

at line 30
static CannotCastData shouldBeTransformableData(string $modelClass, string $attribute)

Create an exception for a non-transformable data cast value.

Parameters

string $modelClass
string $attribute

Return Value

CannotCastData

at line 38
static CannotCastData dataClassMustBeTransformable(string $dataClass)

Create an exception for a non-transformable Eloquent data class.

Parameters

string $dataClass

Return Value

CannotCastData

at line 48
static CannotCastData shouldBeDataClass(string $modelClass, string $attribute, string $dataClass)

Create an exception for a data value of the wrong class.

Parameters

string $modelClass
string $attribute
string $dataClass

Return Value

CannotCastData

at line 61
static CannotCastData invalidStoredValue(string $modelClass, string $attribute)

Create an exception for an invalid stored data representation.

Parameters

string $modelClass
string $attribute

Return Value

CannotCastData

at line 71
static CannotCastData invalidStoredCollectionItem(string $modelClass, string $attribute, int|string $itemKey)

Create an exception for an invalid stored collection item.

Parameters

string $modelClass
string $attribute
int|string $itemKey

Return Value

CannotCastData

at line 84
static CannotCastData invalidMorphEnvelope(string $modelClass, string $attribute)

Create an exception for an invalid abstract data envelope.

Parameters

string $modelClass
string $attribute

Return Value

CannotCastData

at line 94
static CannotCastData invalidMorphClass(string $type, string $dataClass)

Create an exception for a stored data type that names no valid class.

Parameters

string $type
string $dataClass

Return Value

CannotCastData

at line 104
static CannotCastData dataCollectionTypeRequired()

Create an exception for a missing collection item type.

Return Value

CannotCastData