Skip to content

Commit

Permalink
Versionable::createInitialVersion fails if any global scope excludes …
Browse files Browse the repository at this point in the history
…Model (#74)
  • Loading branch information
swolley committed May 15, 2024
1 parent 0281071 commit 7d51fae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Versionable.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function createVersion(array $replacements = [], $time = null): ?Version
public function createInitialVersion(Model $model): Version
{
/** @var \Overtrue\LaravelVersionable\Versionable|Model $refreshedModel */
$refreshedModel = static::query()->findOrFail($model->getKey());
$refreshedModel = static::query()->withoutGlobalScopes()->findOrFail($model->getKey());

/**
* As initial version should include all $versionable fields,
Expand Down

0 comments on commit 7d51fae

Please sign in to comment.