public function auditUpdate()
    {
        try {
            $history = $this->logHistory();
            if (is_null($history)) {
                return false;
            }
            if (isset($this->historyLimit) && $this->logHistory()->count() >= $this->historyLimit) {
                $LimitReached = true;
            } else {
                $LimitReached = false;
            }
            if (isset($this->logCleanup)) {
                $LogCleanup = $this->LogCleanup;
            } else {
                $LogCleanup = false;
            }

            if (((!isset($this->auditEnabled) || $this->auditEnabled) && $this->updating) && (!$LimitReached || $LogCleanup)) {
                $changes_to_record = $this->changedAuditingFields();
                if (count($changes_to_record)) {
                    $log = ['type' => 'updated'];
                    foreach ($changes_to_record as $key => $change) {
                        $log['old_value'][$key] = array_get($this->originalData, $key);
                        $log['new_value'][$key] = array_get($this->updatedData, $key);
                    }

                    $log['related_data'] = $this->getRelatedData();
                    $this->audit($log);
                }
            }
        } catch (Exception $ex) {
            Log::emergency($ex);
            return false;
        }
    }
public function auditUpdate()
    {
        try {
            $history = $this->logHistory();
            if (is_null($history)) {
                return false;
            }
            if (isset($this->historyLimit) && $this->logHistory()->count() >= $this->historyLimit) {
                $LimitReached = true;
            } else {
                $LimitReached = false;
            }
            if (isset($this->logCleanup)) {
                $LogCleanup = $this->LogCleanup;
            } else {
                $LogCleanup = false;
            }

            if (((!isset($this->auditEnabled) || $this->auditEnabled) && $this->updating) && (!$LimitReached || $LogCleanup)) {
                $changes_to_record = $this->changedAuditingFields();
                if (count($changes_to_record)) {
                    $log = ['type' => 'updated'];
                    foreach ($changes_to_record as $key => $change) {
                        $log['old_value'][$key] = array_get($this->originalData, $key);
                        $log['new_value'][$key] = array_get($this->updatedData, $key);
                    }

                    $log['related_data'] = $this->getRelatedData();
                    $this->audit($log);
                }
            }
        } catch (Exception $ex) {
            Log::emergency($ex);
            return false;
        }
    }
public function auditUpdate ( ) { try { $ history = $ this -> logHistory ( ) ; if ( is_null ( $ history ) ) { return false ; } if ( isset ( $ this -> historyLimit ) && $ this -> logHistory ( ) -> count ( ) >= $ this -> historyLimit ) { $ LimitReached = true ; } else { $ LimitReached = false ; } if ( isset ( $ this -> logCleanup ) ) { $ LogCleanup = $ this -> LogCleanup ; } else { $ LogCleanup = false ; } if ( ( ( ! isset ( $ this -> auditEnabled ) || $ this -> auditEnabled ) && $ this -> updating ) && ( ! $ LimitReached || $ LogCleanup ) ) { $ changes_to_record = $ this -> changedAuditingFields ( ) ; if ( count ( $ changes_to_record ) ) { $ log = [ 'type' => 'updated' ] ; foreach ( $ changes_to_record as $ key => $ change ) { $ log [ 'old_value' ] [ $ key ] = array_get ( $ this -> originalData , $ key ) ; $ log [ 'new_value' ] [ $ key ] = array_get ( $ this -> updatedData , $ key ) ; } $ log [ 'related_data' ] = $ this -> getRelatedData ( ) ; $ this -> audit ( $ log ) ; } } } catch ( Exception $ ex ) { Log :: emergency ( $ ex ) ; return false ; } }
Audit updated.
Audit updated .