Skip to content

Commit f72f143

Browse files
Prevent lazyloading (#67)
If not set, the relationship is not lazyloaded and you can get errors like ``` Attempted to lazy load [versionable] on model [Overtrue\LaravelVersionable\Version] but lazy loading is disabled.``` if enforced.
1 parent 57ea731 commit f72f143

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Version.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ class Version extends Model
3636
'contents' => 'json',
3737
];
3838

39+
protected $with = [
40+
'versionable',
41+
];
42+
3943
protected static function booted()
4044
{
4145
static::creating(function (Version $version) {

0 commit comments

Comments
 (0)