class ConvertEmptyStringsToNull extends TransformsRequest

Constants

protected KEY_BYTES_CONTEXT_KEY

Properties

protected int $maxKeyBytes

The maximum cumulative size of the keys processed per request, in bytes.

from  TransformsRequest
protected int $keyBytes

The cumulative size of the keys processed for the current request.

from  TransformsRequest
static protected array<int, callable> $skipCallbacks

All of the registered skip callbacks.

Methods

mixed
handle(Request $request, Closure $next)

Handle an incoming request.

void
clean(Request $request)

Clean the request's data.

void
cleanParameterBag(ParameterBag $bag)

Clean the data in the parameter bag.

array
cleanArray(array $data, string $keyPrefix = '')

Clean the data in the given array.

mixed
cleanValue(string $key, mixed $value)

Clean the given value.

mixed
transform(string $key, mixed $value)

Transform the given value.

static void
skipWhen(Closure $callback)

Register a callback that instructs the middleware to be skipped.

static void
flushState()

Flush all static state.

Details

at line 23
mixed handle(Request $request, Closure $next)

Handle an incoming request.

Parameters

Request $request
Closure $next

Return Value

mixed

in TransformsRequest at line 48
protected void clean(Request $request)

Clean the request's data.

Parameters

Request $request

Return Value

void

in TransformsRequest at line 62
protected void cleanParameterBag(ParameterBag $bag)

Clean the data in the parameter bag.

Parameters

ParameterBag $bag

Return Value

void

in TransformsRequest at line 74
protected array cleanArray(array $data, string $keyPrefix = '')

Clean the data in the given array.

Parameters

array $data
string $keyPrefix

Return Value

array

in TransformsRequest at line 107
protected mixed cleanValue(string $key, mixed $value)

Clean the given value.

Parameters

string $key
mixed $value

Return Value

mixed

at line 37
protected mixed transform(string $key, mixed $value)

Transform the given value.

Parameters

string $key
mixed $value

Return Value

mixed

at line 48
static void skipWhen(Closure $callback)

Register a callback that instructs the middleware to be skipped.

Skip callbacks persist in a static property for the worker lifetime and run on every subsequent request.

Parameters

Closure $callback

Return Value

void

at line 57
static void flushState()

Flush all static state.

Return Value

void