Archived
1
0
Fork 0

Textadventures: one author per game pls

This commit is contained in:
Alexander Yakovlev 2020-11-06 00:27:07 +07:00
parent 19f764053f
commit e28d49dc71
Signed by: oreolek
GPG key ID: 1CDC4B7820C93BD3

View file

@ -87,8 +87,8 @@ class Textadventures extends Source {
}
$game->save();
$game->languages()->sync([$language->id]);
if (isset($author)) {
$game->authors()->sync([$model->id]);
if (isset($author) && !$game->authors()->where('id', $model->id)->exists()) {
$game->authors()->attach($model);
}
});
}