Skip to content

Commit

Permalink
Merge pull request #18 from kenepa/v1/fix-full-usage-of-custom-lock
Browse files Browse the repository at this point in the history
Fixed: full usage of custom "ResourceLock" model class in v1
  • Loading branch information
Jehizkia authored Aug 22, 2023
2 parents 58fec96 + a71b435 commit fb96908
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Models/Concerns/HasLocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public function resourceLock(): MorphOne
public function lock(): bool
{
if (! $this->isLocked()) {
$resourceLock = new ResourceLock;
$resourceLockModel = config('resource-lock.models.ResourceLock', ResourceLock::class);
$resourceLock = new $resourceLockModel;
$resourceLock->user_id = auth()->user()->id;
$this->resourceLock()->save($resourceLock);

Expand Down

0 comments on commit fb96908

Please sign in to comment.