Skip to content

Commit

Permalink
Related field association occurs as an event, so propagate last
Browse files Browse the repository at this point in the history
  • Loading branch information
octoberapp committed Aug 8, 2023
1 parent 45cd08c commit cdb356a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Database/Traits/Multisite.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ public function initializeMultisite()

$this->bindEvent('model.beforeSave', [$this, 'multisiteBeforeSave']);

$this->bindEvent('model.afterSave', [$this, 'multisiteAfterSave']);

$this->bindEvent('model.afterCreate', [$this, 'multisiteAfterCreate']);

// Process propagation last so relations are all set up correctly
$this->bindEvent('model.afterSave', [$this, 'multisiteAfterSave'], -1);

$this->defineMultisiteRelations();
}

Expand Down

0 comments on commit cdb356a

Please sign in to comment.