This pull request fixes an issue where the Status Log field couldn't be queried due to the new format introduced in #956.
After the changes in #956, querying the status log would result in nothing being returned because stuff was being returned in a different format than previously.
// Used to work but doesn't after #956
Entry::query()
->where('collection', 'orders')
->whereDate('status_log->paid', '>=', '2024-01-01');
This PR essentially maps the new format into what was being returned first - where it's a key/value array with the status and timestamp. This allows for this:
If you have the same status repeated multiple times in your "status log", the latest event of that status will be the one used for querying.
This pull request fixes an issue where the Status Log field couldn't be queried due to the new format introduced in #956.
After the changes in #956, querying the status log would result in nothing being returned because stuff was being returned in a different format than previously.
This PR essentially maps the new format into what was being returned first - where it's a key/value array with the status and timestamp. This allows for this:
If you have the same status repeated multiple times in your "status log", the latest event of that status will be the one used for querying.