8000 Hydrator Simplification · Issue #69 · cloudcreativity/laravel-json-api · GitHub
[go: up one dir, main page]

Skip to content
Hydrator Simplification #69
Closed
Closed
@lindyhopchris

Description

@lindyhopchris

The two step hydration process is too complex. To make this simpler, the point at which records are saved should be moved into the hydrator - i.e. the hydrator is responsible for transferring the data into the domain record plus persisting the change. (In cases where it is creating a new domain record, it can therefore also create the record).

This means for the Eloquent hydrator, the fact that some data transfer needs to occur after the primary domain record has been created is hidden internally within the Eloquent hydrator.

The creating, created etc hooks can still be on the controller as the controller knows what it is doing when passing off to the hydrator. Likewise, the transaction should also be on the controller, as it wraps the entire process.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0