PropsResolver
class PropsResolver
Traits
Properties
| protected Request | $request | The current request instance. |
|
| protected string | $component | The component being rendered. |
|
| protected bool | $isPartial | Whether this is a partial request for the given component. |
|
| protected bool | $isInertia | Whether this is an Inertia request. |
|
| protected null|array<int, string> | $only | The props to include in the partial response. |
|
| protected null|array<int, string> | $except | The props to exclude from the partial response. |
|
| protected array<int, string> | $resetProps | The props that should have their merge state reset. |
|
| protected array<int, string> | $loadedOnceProps | The once-props that the client has already loaded. |
|
| protected array<string, array<int, string>> | $deferredProps | The deferred props grouped by their defer group. |
|
| protected array<int, string> | $rescuedProps | The deferred props that were rescued during resolution. |
|
| protected array<int, string> | $mergeProps | The props that should be appended to existing client-side data. |
|
| protected array<int, string> | $prependProps | The props that should be prepended to existing client-side data. |
|
| protected array<int, string> | $deepMergeProps | The props that should be deep merged with existing client-side data. |
|
| protected array<int, string> | $matchPropsOn | The key matching strategies for mergeable props. |
|
| protected array<string, array<string, mixed>> | $scrollProps | The scroll pagination metadata for each scroll prop. |
|
| protected array<string, array<string, mixed>> | $onceProps | The once-prop metadata for each once prop. |
|
| protected array<int, string> | $sharedPropKeys | The top-level keys of shared props. |
Methods
Call the given value if callable and inject its dependencies.
Determine if the given value is callable, but not a string.
Resolve the given shared and page props, collecting their metadata.
Resolve shared property providers and collect shared prop keys.
Resolve ProvidesInertiaProperties instances into keyed props.
Build the non-empty metadata arrays for the page response.
Recursively resolve the props tree, collecting metadata along the way.
Determine if a prop should be included in a partial response. AlwaysProp and children of already-resolved values bypass partial filtering.
Determine if the given path matches the current partial request using bidirectional prefix matching on the only/except headers.
Determine if a prop should be excluded from the initial page response.
Exclude an IgnoreFirstLoad prop from the initial response while collecting its deferred, merge, and once metadata.
Exclude a deferred prop from the initial response while collecting its deferred-group and merge metadata.
Exclude a once-prop that the client has already loaded while preserving its once metadata for the client.
Determine if a once-prop has already been loaded by the client.
Resolve a single prop value through the resolution pipeline.
Determine if the value is a prop type that requires further filtering or metadata collection.
Collect metadata for a prop that will be included in the response.
Collect the deferred prop and its group.
Collect the merge strategy for a mergeable prop.
Collect once-prop metadata.
Determine if the path should contribute metadata during a partial request.
Determine if the path matches or is a descendant of an "only" filter path.
Determine if the path is an ancestor of an "only" filter path.
Determine if the path matches or is a descendant of an "except" filter path.
Unpack top-level dot-notation keys into nested arrays.
Resolve closures and Arrayable values along the intermediate segments of a dot-notation path so that Arr::set can nest into them.
Parse a comma-separated header value into an array.
Details
in
ResolvesCallables at line 14
protected mixed
resolveCallable(mixed $value)
Call the given value if callable and inject its dependencies.
in
ResolvesCallables at line 22
protected bool
useAsCallable(mixed $value)
Determine if the given value is callable, but not a string.
at line 135
__construct(Request $request, string $component)
Create a new props resolver instance.
at line 155
array
resolve(array $shared, array $props)
Resolve the given shared and page props, collecting their metadata.
at line 171
protected array
resolveSharedProps(array $shared)
Resolve shared property providers and collect shared prop keys.
at line 196
protected array
resolvePropertyProviders(array $props)
Resolve ProvidesInertiaProperties instances into keyed props.
at line 221
protected array
buildMetadata()
Build the non-empty metadata arrays for the page response.
at line 242
protected array
resolveProps(array $props, string $prefix = '', bool $parentWasResolved = false)
Recursively resolve the props tree, collecting metadata along the way.
at line 303
protected bool
shouldIncludeInPartialResponse(mixed $prop, string $path, bool $parentWasResolved)
Determine if a prop should be included in a partial response. AlwaysProp and children of already-resolved values bypass partial filtering.
at line 316
protected bool
pathMatchesPartialRequest(string $path)
Determine if the given path matches the current partial request using bidirectional prefix matching on the only/except headers.
at line 333
protected bool
excludeFromInitialResponse(mixed $prop, string $path)
Determine if a prop should be excluded from the initial page response.
Each exclusion type collects its metadata before the prop is removed.
at line 363
protected bool
excludeIgnoredProp(mixed $prop, string $path)
Exclude an IgnoreFirstLoad prop from the initial response while collecting its deferred, merge, and once metadata.
at line 385
protected bool
excludeDeferredProp(Deferrable $prop, string $path)
Exclude a deferred prop from the initial response while collecting its deferred-group and merge metadata.
at line 400
protected bool
excludeAlreadyLoadedProp(mixed $prop, string $path)
Exclude a once-prop that the client has already loaded while preserving its once metadata for the client.
at line 410
protected bool
wasAlreadyLoadedByClient(mixed $prop, string $path)
Determine if a once-prop has already been loaded by the client.
at line 423
protected mixed
resolveValue(mixed $value, string $path, array $siblings)
Resolve a single prop value through the resolution pipeline.
at line 472
protected bool
isPropType(mixed $value)
Determine if the value is a prop type that requires further filtering or metadata collection.
at line 484
protected void
collectMetadata(mixed $prop, string $path)
Collect metadata for a prop that will be included in the response.
at line 502
protected void
collectDeferredPropMetadata(string $path, Deferrable $prop)
Collect the deferred prop and its group.
at line 510
protected void
collectMergeableMetadata(string $path, Mergeable $prop)
Collect the merge strategy for a mergeable prop.
at line 545
protected void
collectScrollMetadata(string $path, ScrollProp $prop)
Collect scroll pagination metadata.
at line 556
protected void
collectOnceMetadata(string $path, mixed $prop)
Collect once-prop metadata.
at line 575
protected bool
isIncludedInPartialMetadata(string $path)
Determine if the path should contribute metadata during a partial request.
at line 591
protected bool
matchesOnly(string $path)
Determine if the path matches or is a descendant of an "only" filter path.
at line 605
protected bool
leadsToOnly(string $path)
Determine if the path is an ancestor of an "only" filter path.
at line 619
protected bool
matchesExcept(string $path)
Determine if the path matches or is a descendant of an "except" filter path.
at line 636
protected array
unpackDotProps(array $props)
Unpack top-level dot-notation keys into nested arrays.
at line 665
protected void
ensurePathIsTraversable(array $props, string $dotKey)
Resolve closures and Arrayable values along the intermediate segments of a dot-notation path so that Arr::set can nest into them.
at line 698
protected array|null
parseHeader(string $key)
Parse a comma-separated header value into an array.