Using Closures
When using a closure, you have access to the underlying data object:The with Method
Add extra properties by overwriting thewith method within your data object:
endpoints key:
Use Cases
Appending properties is useful for:API Endpoints
Add related API endpoints for the resource
Computed Values
Include calculated or derived properties
Metadata
Attach metadata like timestamps or versions
Permissions
Include user-specific permission flags