From f3994f4a07a9feaabf5185aae8fc85dd1607bb8b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 21 Apr 2019 22:28:45 +1000 Subject: [PATCH] Rename listeners --- .../Client/CreatedClientActivity.php | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 app/Listeners/Client/CreatedClientActivity.php diff --git a/app/Listeners/Client/CreatedClientActivity.php b/app/Listeners/Client/CreatedClientActivity.php new file mode 100644 index 000000000000..b73ca9ce39dd --- /dev/null +++ b/app/Listeners/Client/CreatedClientActivity.php @@ -0,0 +1,41 @@ +activityRepo = $activityRepo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + + $fields = new \stdClass; + + $fields->client_id = $event->client->id; + $fields->user_id = $event->client->user_id; + $fields->company_id = $event->client->company_id; + $fields->activity_type_id = Activity::CREATE_CLIENT; + + $this->activityRepo->save($fields, $event->client); + } +}