Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disableVersioning() is not working #54

Open
msassa opened this issue Oct 18, 2019 · 1 comment
Open

disableVersioning() is not working #54

msassa opened this issue Oct 18, 2019 · 1 comment

Comments

@msassa
Copy link

msassa commented Oct 18, 2019

I'm implementing a method to go back to previous version of a model, and like we know, do that actually create a new version of the model.
So, in order to avoid that, I'm doing this:

        $block = Block::findOrFail($block_id);
        if ($block->previousVersion()) {
            $block->disableVersioning()->previousVersion()->revert();
            return response()->json(
                [
                    'message' => 'Version reverted!'
                ],
                200
            );
        }

And still I'm getting a new version when revert.

@ehsantalkhouncheh
Copy link

ehsantalkhouncheh commented Nov 3, 2021

I have same issue i realized that after disable versioning the value of versioningEnabled is false but it doesnt work and it create record in database

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants