Replies: 2 comments 4 replies
-
You mean like in transactions? |
Beta Was this translation helpful? Give feedback.
-
thanks for replies.
no, I'm not. its actually at run time and checkpoint (or snapshot or what ever we named) saves only on memory.
As previously mentioned, there are situations where we require a specific state of model data, often after making modifications or reverting to a previously checkpointed or snapshot state. Furthermore, as @Sophist-UK pointed out, we have the flexibility to create custom model types through third-party extensions or plugins. However, it's generally recommended to reserve these customizations for core concerns within Eloquent. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone,
I have a suggestion regarding Eloquent models, specifically concerning methods like
getChanges
,getOriginal
, andisDirty
. Often, we find ourselves sharing models between various classes, providers, and libraries. These components may modify the model object to fulfill their responsibilities, and at times, other classes might need access to the complete model information from a few steps back, which isn't necessarily the original state.In light of this, I propose the introduction of a "checkpoint" feature for models. This feature can be implemented by developing a set of useful methods with names like:
Implementing these checkpoint methods would enhance the flexibility and usability of Eloquent models, making it easier to manage state changes and retrieve specific model states when necessary.
Beta Was this translation helpful? Give feedback.
All reactions