class JsonEncodingException extends RuntimeException (View source)

Methods

forModel(mixed $model, string $message)

Create a new JSON encoding exception for the model.

forResource(JsonResource $resource, string $message)

Create a new JSON encoding exception for the resource.

forAttribute(mixed $model, mixed $key, string $message)

Create a new JSON encoding exception for an attribute.

Details

static JsonEncodingException forModel(mixed $model, string $message)

Create a new JSON encoding exception for the model.

Parameters

mixed $model
string $message

Return Value

JsonEncodingException

static JsonEncodingException forResource(JsonResource $resource, string $message)

Create a new JSON encoding exception for the resource.

Parameters

JsonResource $resource
string $message

Return Value

JsonEncodingException

static JsonEncodingException forAttribute(mixed $model, mixed $key, string $message)

Create a new JSON encoding exception for an attribute.

Parameters

mixed $model
mixed $key
string $message

Return Value

JsonEncodingException