I am using the reason inside an updated event. It seems like reason is reset before this event is triggered, So I figured I just fetch it from the current version, but for some (likely stupid) reason, I sometimes then get the previous and not the current version. I assume there is some caching going on, so I wonder how I can reliably ensure I get the actual current version and not some cached instance that is no longer valid after the update?
public function updated(Foo $foo)
{
$version = $foo->currentVersion();
$action = $version->reason;
I am using the
reasoninside anupdatedevent. It seems likereasonis reset before this event is triggered, So I figured I just fetch it from the current version, but for some (likely stupid) reason, I sometimes then get the previous and not the current version. I assume there is some caching going on, so I wonder how I can reliably ensure I get the actual current version and not some cached instance that is no longer valid after the update?