From 97a364f5c144b54e26db1d0dbb51b522cc5055d0 Mon Sep 17 00:00:00 2001 From: Faruk Nasir Date: Mon, 17 Jul 2023 09:38:16 +0100 Subject: [PATCH] chore: data passed to events --- src/Actions/CreateContact.php | 2 +- src/Actions/DeleteContact.php | 2 +- src/Actions/UpdateContact.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Actions/CreateContact.php b/src/Actions/CreateContact.php index 8b8461f..cb18c86 100644 --- a/src/Actions/CreateContact.php +++ b/src/Actions/CreateContact.php @@ -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; } diff --git a/src/Actions/DeleteContact.php b/src/Actions/DeleteContact.php index 86c14a1..7ce9a83 100644 --- a/src/Actions/DeleteContact.php +++ b/src/Actions/DeleteContact.php @@ -21,6 +21,6 @@ public function __invoke($user, $contact) $contact->delete(); - event(new ContactDeleted(contact: $contact)); + event(new ContactDeleted(user: $user, contact: $contact)); } } diff --git a/src/Actions/UpdateContact.php b/src/Actions/UpdateContact.php index cd74d4b..ecc7c4d 100644 --- a/src/Actions/UpdateContact.php +++ b/src/Actions/UpdateContact.php @@ -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(); }