feat(#22): Implemented Resource & Collection with JsonResource support #66
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.

Standardize API Responses with Resource & Collection
Overview
This PR implements a structured system for API responses in the
@h3ravel/httppackage using Resources and Collections. The changes introduce a Laravel-inspired developer experience while keeping H3ravel’s unique styleKey features include:
Resourceclass: Wraps a single model or object and provides atoArray()method for serialization.Collectionclass: Handles arrays ofResourceobjects, supports pagination metadata, and link structures.JsonResourcehelper: Automatically formats singleResourceorCollectionresponses into the standardized JSON structureChanges
Resource
withRelation/withRelationstoArray()to convert models and relationships into plain objectsCollection
Resourceobjects or plain objectsmeta) and links (links) in responsestoArray()andjson()methods for consistent outputJsonResource
Resource,Collection, or plain object{ data: { ... } }{ data: [...], meta: {...}, links: {...} }Tests
Developer Experience
Resourcefrom a controller produces{ data: { ... } }Collectionproduces{ data: [...], meta: {...}, links: {...} }Example Usage
How to run tests