src/Modelling/ModelState.php
public function hasChanged()
    {
        foreach ($this->modelData as $property => $value) {
            if ($this->hasPropertyChanged($property)) {
                return true;
            }
        }

        // In case model data has been manually unset
        $manuallyUnsetProperties = array_diff_key($this->changeSnapshotData, $this->modelData);
        foreach ($manuallyUnsetProperties as $property => $value) {
            // If it wasn't null before, that's a change
            if ($value !== null) {
                return true;
            }
        }

        return false;
    }
public function hasChanged()
    {
        foreach ($this->modelData as $property => $value) {
            if ($this->hasPropertyChanged($property)) {
                return true;
            }
        }

        // In case model data has been manually unset
        $manuallyUnsetProperties = array_diff_key($this->changeSnapshotData, $this->modelData);
        foreach ($manuallyUnsetProperties as $property => $value) {
            // If it wasn't null before, that's a change
            if ($value !== null) {
                return true;
            }
        }

        return false;
    }
public function hasChanged ( ) { foreach ( $ this -> modelData as $ property => $ value ) { if ( $ this -> hasPropertyChanged ( $ property ) ) { return true ; } } // In case model data has been manually unset $ manuallyUnsetProperties = array_diff_key ( $ this -> changeSnapshotData , $ this -> modelData ) ; foreach ( $ manuallyUnsetProperties as $ property => $ value ) { // If it wasn't null before, that's a change if ( $ value !== null ) { return true ; } } return false ; }
Returns true if the model has changed

@return bool
Returns true if the model has changed