getArchiveQueue() as $orthanc_uuid) { $study_id = Studies::getStudyIdByOrthancUuid($orthanc_uuid); if ($study_id === null) { continue; } $payload = [ 'archived_at' => now(), 'updated_at' => now(), ]; DB::table('studies')->where('id', $study_id)->update($payload); audit() ->by(sync_agent_id()) ->category(Category::SYSTEM) ->on($study_id) ->orthanc($orthanc_uuid) ->did(Activity::Study_Archive) ->log(false); } return $next($sync); } }