TrimStrings
class TrimStrings extends TransformsRequest
Properties
| protected array<int, string> | $except | The attributes that should not be trimmed. |
|
| static protected array<int, string> | $neverTrim | The globally ignored attributes that should not be trimmed. |
|
| static protected array<int, callable> | $skipCallbacks | All of the registered skip callbacks. |
Methods
Clean the data in the parameter bag.
Clean the data in the given array.
Transform the given value.
Determine if the given key should be skipped.
Indicate that the given attributes should never be trimmed.
Flush all static state.
Details
in
TransformsRequest at line 26
protected void
clean(Request $request)
Clean the request's data.
in
TransformsRequest at line 40
protected void
cleanParameterBag(ParameterBag $bag)
Clean the data in the parameter bag.
in
TransformsRequest at line 48
protected array
cleanArray(array $data, string $keyPrefix = '')
Clean the data in the given array.
in
TransformsRequest at line 60
protected mixed
cleanValue(string $key, mixed $value)
Clean the given value.
at line 56
protected mixed
transform(string $key, mixed $value)
Transform the given value.
at line 70
protected bool
shouldSkip(string $key, array $except)
Determine if the given key should be skipped.
at line 81
static void
except(array|string $attributes)
Indicate that the given attributes should never be trimmed.
Boot-only. The list persists in a static property for the worker lifetime and applies to every subsequent request.
at line 94
static void
skipWhen(Closure $callback)
Register a callback that instructs the middleware to be skipped.
Boot-only. Skip callbacks persist in a static property for the worker lifetime and run on every subsequent request.
at line 102
static void
flushState()
Flush all static state.