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

Disble lock for a model #1

Open
robjuz opened this issue Sep 19, 2022 · 0 comments
Open

Disble lock for a model #1

robjuz opened this issue Sep 19, 2022 · 0 comments

Comments

@robjuz
Copy link

robjuz commented Sep 19, 2022

First of all, thanks for the fork!

When I try to disable the lock, the following error occurs

PHP Fatal error:  App\\Models\\MyModel and Quarks\\Laravel\\Locking\\LocksVersion define the same property ($lockEnabled) in the composition of App\\Models\\MyModel. However, the definition differs and is considered incompatible. Class was composed in /var/www/html/app/Models/MyModel.php on line 19

You should not define the protected $lockEnabled = true; property in the trait

and then something like this

            if (!isset($this->lockEnabled) || $this->lockEnabled) {
                $query->where(static::lockVersionColumnName(), '=', $this->currentLockVersion());
            }

When the lockEnabled is not present, or is true, do you stuff, when set to false, skip

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

1 participant