Repository navigation
Prepare, cache and document resource payloads - #3
Merged
Merged
Conversation
Resources that use PreparesResources declare what they render with #[Includes] and #[Counts]. Cogent loads it for every model once, right before the collection resolves, through collection(), toResourceCollection(), paginators, ResourceCollection subclasses and single resources. Nested resource plans run in the same pass, cacheable relations come from the cache, and anything already loaded is skipped. Also run the morph map reset after every test: a top-level afterEach in Pest.php never attached to any test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#[Includable] declares relations a resource renders only when the request names them in ?include= (or another parameter set with Cogent::includeParameter()). Undeclared paths are ignored, and nested paths are handed to the resource that renders the relation, which only loads what it declares itself. The preparer now remembers which models it prepared for each resource, so nested resources resolved while the response is encoded do not prepare again from the root request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uard" This reverts commit 7512b20.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cogent:asyncapiDocumentation
Scramble is an optional dev dependency used only for schema exports. AsyncAPI channel extraction is static; runtime-dependent channel parts use
{parameter}and are marked withx-cogent.dynamic.Breaking change
BroadcastsAsResourceincludes Laravel'sBroadcastsEvents; models must not use both traits.Benchmark
200 posts with author, author tags and post count, and comment count (in-memory SQLite):
Verification
composer test: 150 passed, 485 assertionscomposer lint: passedcomposer analyse: passedcomposer validate --strict --no-check-lock: passed