Skip to content

Commit

Permalink
Merge pull request #3 from starfolksoftware/feat/pass-data-to-events
Browse files Browse the repository at this point in the history
chore: data passed to events
  • Loading branch information
frknasir authored Jul 17, 2023
2 parents eb8e7a6 + 97a364f commit 36ef41f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Actions/CreateContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __invoke($user, array $data, $teamId = null)
Ally::findTeamByIdOrFail($teamId)->contacts()->create($fields) :
Ally::newContactModel()->create($fields);

event(new ContactCreated(contact: $contact));
event(new ContactCreated(user: $user, contact: $contact, data: $data));

return $contact;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Actions/DeleteContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public function __invoke($user, $contact)

$contact->delete();

event(new ContactDeleted(contact: $contact));
event(new ContactDeleted(user: $user, contact: $contact));
}
}
2 changes: 1 addition & 1 deletion src/Actions/UpdateContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __invoke($user, $contact, array $data)

$contact->refresh();

event(new ContactUpdated(contact: $contact));
event(new ContactUpdated(user: $user, contact: $contact, data: $data));

return $contact->refresh();
}
Expand Down

0 comments on commit 36ef41f

Please sign in to comment.