Skip to content

Commit

Permalink
Widen multisite relation scope
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Mar 15, 2024
1 parent 84bf798 commit 9e46fed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Database/Traits/Multisite.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ protected function defineMultisiteRelation($name, $type = null)
}

// Override the local key to the shared root identifier
if ($type === 'belongsToMany') {
if (in_array($type, ['belongsToMany', 'morphedByMany', 'morphToMany'])) {
$this->$type[$name]['parentKey'] = 'site_root_id';
}
elseif (in_array($type, ['belongsTo', 'hasOne', 'hasMany'])) {
Expand Down

0 comments on commit 9e46fed

Please sign in to comment.