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{pageName: string, previousPage: null|int|string, nextPage: null|int|string, currentPage: null|int|string, reset: bool}> | $scrollProps | The scroll pagination metadata for each scroll prop. |
|
| protected array<string, array{prop: string, expiresAt: null|int}> | $onceProps | The once-prop metadata for each once prop. |
|
| protected array<string, array{listeners: array<int, array{channel: array{name: string, type: string}, events: array<int, string>}>, throttle?: int}> | $liveProps | The live update listeners for each live prop. |
|
| protected array<int, string> | $sharedPropKeys | The top-level keys of shared props. |
|
| protected RequestRecorder|null | $recorder | The devtools recorder, resolved only while recording is active. It stays null when devtools is disabled so the per-prop resolution loop never touches it, keeping the hot path free of recorder calls, container lookups, and prop classification. |
Methods
Invoke a value whose public contract guarantees it is callable.
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 the given broadcast props. Dot-notation keys stay flat and literal, since only a page response unpacks them into nested arrays.
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 a prop is resolved independently of partial request filters.
Determine if an already-materialized prop tree contains an always prop.
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.
Collect the live update listeners for a live prop. Emitted on every response, so a partial reload keeps the listeners it refreshed up to date.
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.
Determine if a dot path matches another path or belongs to its subtree.
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
invokeCallable(callable $value)
Invoke a value whose public contract guarantees it is callable.
in
ResolvesCallables at line 22
protected mixed
resolveCallable(mixed $value)
Call the given value if callable and inject its dependencies.
in
ResolvesCallables at line 30
protected bool
useAsCallable(mixed $value)
Determine if the given value is callable, but not a string.
at line 153
__construct(Request $request, string $component)
Create a new props resolver instance.
at line 175
array
resolve(array $shared, array $props)
Resolve the given shared and page props, collecting their metadata.
at line 192
array
resolveBroadcastProps(array $props, string $prefix = '')
Resolve the given broadcast props. Dot-notation keys stay flat and literal, since only a page response unpacks them into nested arrays.
at line 230
protected array
resolveSharedProps(array $shared)
Resolve shared property providers and collect shared prop keys.
at line 257
protected array
resolvePropertyProviders(array $props)
Resolve ProvidesInertiaProperties instances into keyed props.
at line 282
protected array
buildMetadata()
Build the non-empty metadata arrays for the page response.
at line 304
protected array
resolveProps(array $props, string $prefix = '', bool $parentWasResolved = false)
Recursively resolve the props tree, collecting metadata along the way.
at line 373
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 389
protected bool
bypassesPartialFiltering(mixed $prop, bool $parentWasResolved)
Determine if a prop is resolved independently of partial request filters.
at line 399
protected bool
containsAlwaysProp(array $props)
Determine if an already-materialized prop tree contains an always prop.
at line 415
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 432
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 467
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 489
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 504
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 514
protected bool
wasAlreadyLoadedByClient(mixed $prop, string $path)
Determine if a once-prop has already been loaded by the client.
at line 527
protected mixed
resolveValue(mixed $value, string $path, array $siblings)
Resolve a single prop value through the resolution pipeline.
at line 581
protected bool
isPropType(mixed $value)
Determine if the value is a prop type that requires further filtering or metadata collection.
at line 594
protected void
collectMetadata(mixed $prop, string $path, bool $parentWasResolved)
Collect metadata for a prop that will be included in the response.
at line 619
protected void
collectDeferredPropMetadata(string $path, Deferrable $prop)
Collect the deferred prop and its group.
at line 627
protected void
collectMergeableMetadata(string $path, Mergeable $prop)
Collect the merge strategy for a mergeable prop.
at line 662
protected void
collectScrollMetadata(string $path, ScrollProp $prop)
Collect scroll pagination metadata.
at line 673
protected void
collectOnceMetadata(string $path, mixed $prop)
Collect once-prop metadata.
at line 693
protected void
collectLiveMetadata(string $path, SupportsLiveUpdates $prop, bool $parentWasResolved)
Collect the live update listeners for a live prop. Emitted on every response, so a partial reload keeps the listeners it refreshed up to date.
at line 711
protected bool
isIncludedInPartialMetadata(string $path)
Determine if the path should contribute metadata during a partial request.
at line 727
protected bool
matchesOnly(string $path)
Determine if the path matches or is a descendant of an "only" filter path.
at line 741
protected bool
leadsToOnly(string $path)
Determine if the path is an ancestor of an "only" filter path.
at line 755
protected bool
matchesExcept(string $path)
Determine if the path matches or is a descendant of an "except" filter path.
at line 769
protected bool
pathIsSameOrDescendant(string $path, string $parent)
Determine if a dot path matches another path or belongs to its subtree.
at line 780
protected array
unpackDotProps(array $props)
Unpack top-level dot-notation keys into nested arrays.
at line 813
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 846
protected array|null
parseHeader(string $key)
Parse a comma-separated header value into an array.