public function revert($id)
    {
        $archive = Archive::find($id);

        $model = app($archive->entity_type);
        $modelInstance = $model->find($archive->entity_id);

        $archiveData = (array) json_decode($archive->entity_data);

        $modelInstance->fill($archiveData);
        $modelInstance->save();

        Cms::notification('Reversion was successful', 'success');

        return redirect(URL::previous());
    }
public function revert($id)
    {
        $archive = Archive::find($id);

        $model = app($archive->entity_type);
        $modelInstance = $model->find($archive->entity_id);

        $archiveData = (array) json_decode($archive->entity_data);

        $modelInstance->fill($archiveData);
        $modelInstance->save();

        Cms::notification('Reversion was successful', 'success');

        return redirect(URL::previous());
    }
public function revert ( $ id ) { $ archive = Archive :: find ( $ id ) ; $ model = app ( $ archive -> entity_type ) ; $ modelInstance = $ model -> find ( $ archive -> entity_id ) ; $ archiveData = ( array ) json_decode ( $ archive -> entity_data ) ; $ modelInstance -> fill ( $ archiveData ) ; $ modelInstance -> save ( ) ; Cms :: notification ( 'Reversion was successful' , 'success' ) ; return redirect ( URL :: previous ( ) ) ; }
Rollback to a previous version of an entity, a specific moment.

@param int $id

@return Redirect
Rollback to a previous version of an entity a specific moment .