Skip to content

Commit

Permalink
Merge pull request #23 from arall/hotfix/docs
Browse files Browse the repository at this point in the history
Fixes Many To Many Polymorphic Relations Docs
  • Loading branch information
chelout authored May 7, 2019
2 parents 7233576 + 776c115 commit 0d66ad8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions doc/7-many-to-many-polymorphic.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ Now we should listen our events, for example we can register event listners in m
* Many To Many Polymorphic Relationship Events
*/

static::morphToManyAttaching(function ($parent, $ids, $attributes) {
static::morphToManyAttaching(function ($relation, $parent, $attributes) {
Log::info("Attaching tags to post {$parent->title}.");
});

static::morphToManyAttached(function ($parent, $ids, $attributes) {
static::morphToManyAttached(function ($relation, $parent, $attributes) {
Log::info("Tags have been attached to post {$parent->title}.");
});
}
Expand Down Expand Up @@ -151,11 +151,11 @@ Now we should listen our events, for example we can register event listners in m
* Many To Many Polymorphic Relationship Events
*/

static::morphedByManyAttaching(function ($parent, $ids, $attributes) {
static::morphedByManyAttaching(function ($relation, $parent, $attributes) {
Log::info("Attaching post to tag {$parent->name}.");
});

static::morphedByManyAttached(function ($parent, $ids, $attributes) {
static::morphedByManyAttached(function ($relation, $parent, $attributes) {
Log::info("Post has been attached to tag {$parent->name}.");
});
}
Expand All @@ -179,4 +179,4 @@ Now we should listen our events, for example we can register event listners in m
- events have $relation name, $parent model, $ids detaching model ids, $attributes additional data
#### MorphedByMany::updateExistingPivot
- fires morphedByManyUpdatingExistingPivot, morphedByManyUpdatedExistingPivot
- events have $relation name, $parent model, $id updating model id, $attributes additional data
- events have $relation name, $parent model, $id updating model id, $attributes additional data

0 comments on commit 0d66ad8

Please sign in to comment.