src/Vzool/Revisionable/RevisionableTrait.php
/**
     * If softdeletes are enabled, store the deleted time
     */
If softdeletes are enabled, store the deleted time
If softdeletes are enabled store the deleted time
public function postDelete()
    {
        if ((!isset($this->revisionEnabled) || $this->revisionEnabled)
            && $this->isSoftDelete()
            && $this->isRevisionable($this->getDeletedAtColumn())
        ) {
            $revisions[] = array(
                'revisionable_type' => $this->getMorphClass(),
                'revisionable_id' => $this->getKey(),
                'key' => $this->getDeletedAtColumn(),
                'old_value' => null,
                'new_value' => $this->{$this->getDeletedAtColumn()},
                'user_id' => $this->getSystemUserId(),
                'ip' => $_SERVER["REMOTE_ADDR"],
                'created_at' => new \DateTime(),
                'updated_at' => new \DateTime(),
            );
            $revisions = array_merge($revisions[0], $this->getAdditionalFields());
            $revision = Revisionable::newModel();
            \DB::table($revision->getTable())->insert($revisions);
            \Event::dispatch('revisionable.deleted', array('model' => $this, 'revisions' => $revisions));
        }
    }
public function postDelete ( ) { if ( ( ! isset ( $ this -> revisionEnabled ) || $ this -> revisionEnabled ) && $ this -> isSoftDelete ( ) && $ this -> isRevisionable ( $ this -> getDeletedAtColumn ( ) ) ) { $ revisions [ ] = array ( 'revisionable_type' => $ this -> getMorphClass ( ) , 'revisionable_id' => $ this -> getKey ( ) , 'key' => $ this -> getDeletedAtColumn ( ) , 'old_value' => null , 'new_value' => $ this -> { $ this -> getDeletedAtColumn ( ) } , 'user_id' => $ this -> getSystemUserId ( ) , 'ip' => $ _SERVER [ " REMOTE_ADDR " ] , 'created_at' => new \ DateTime ( ) , 'updated_at' => new \ DateTime ( ) , ) ; $ revisions = array_merge ( $ revisions [ 0 ] , $ this -> getAdditionalFields ( ) ) ; $ revision = Revisionable :: newModel ( ) ; \ DB :: table ( $ revision -> getTable ( ) ) -> insert ( $ revisions ) ; \ Event :: dispatch ( 'revisionable.deleted' , array ( 'model' => $ this , 'revisions' => $ revisions ) ) ; } }
If softdeletes are enabled, store the deleted time
If softdeletes are enabled store the deleted time
//Since there is only one revision because it's deleted, let's just merge into revision[0]