Skip to content

Commit 7dc7557

Browse files
authored
Merge pull request #18 from tanthammar/patch-1
Avoid problems with seeders and factories
2 parents 325f37e + 94e868e commit 7dc7557

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Models/TeamworkTeam.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected static function boot()
5656
static::creating(function ($model) {
5757
$model->uuid = (string)Uuid::uuid1();
5858
$model->slug = Str::slug($model->name);
59-
$model->owner_id = auth()->user()->getKey();
59+
$model->owner_id = $model->owner_id ?? auth()->user()->getKey();
6060
});
6161

6262
static::updating(function ($model) {

0 commit comments

Comments
 (0)