diff --git a/app/Classes/Modules/ControllersLogic/Accounts/CreateAccountInvitationLogic.php b/app/Classes/Modules/ControllersLogic/Accounts/CreateAccountInvitationLogic.php index a84f4a3..5b6e723 100644 --- a/app/Classes/Modules/ControllersLogic/Accounts/CreateAccountInvitationLogic.php +++ b/app/Classes/Modules/ControllersLogic/Accounts/CreateAccountInvitationLogic.php @@ -49,7 +49,6 @@ class CreateAccountInvitationLogic $invitation = $this->createUserInvitation->execute($object); - event(new UserInvited($invitation)); return new JsonResponse("Invitation have been sent!", HttpStatus::RESOURCE_CREATED); diff --git a/app/Events/Accounts/UserHasRegistered.php b/app/Events/Accounts/UserHasRegistered.php index 60ef36a..a8e624d 100644 --- a/app/Events/Accounts/UserHasRegistered.php +++ b/app/Events/Accounts/UserHasRegistered.php @@ -21,7 +21,7 @@ class UserHasRegistered implements UserEvent { /** * @return User */ - public function getUser(): User { + public function getData(): User { return $this->user; } } diff --git a/app/Listeners/Accounts/UserEventHandler.php b/app/Listeners/Accounts/UserEventHandler.php index fadef6b..0474c35 100644 --- a/app/Listeners/Accounts/UserEventHandler.php +++ b/app/Listeners/Accounts/UserEventHandler.php @@ -17,17 +17,17 @@ class UserEventHandler { public function handle(UserEvent $event): void { if ($event instanceof UserHasRegistered) { - $attempts = UserEmailVerification::where('email', $event->getUser()->email); + $attempts = UserEmailVerification::where('email', $event->getData()->email); - if ($attempts !== null && !$event->getUser()->hasVerifiedEmail()) { - $event->getUser()->notify(new VerifyEmail($attempts->first())); + if ($attempts !== null && !$event->getData()->hasVerifiedEmail()) { + $event->getData()->notify(new VerifyEmail($attempts->first())); $attempts->first()->update(['is_sent' => true]); } } if ($event instanceof UserInvited) { - $event->getInvitation()->notify(new InvitationEmail($event)); + $event->getData()->notify(new InvitationEmail($event)); } } diff --git a/app/Notifications/InvitationEmail.php b/app/Notifications/InvitationEmail.php index 1781a03..1a2eed9 100644 --- a/app/Notifications/InvitationEmail.php +++ b/app/Notifications/InvitationEmail.php @@ -14,7 +14,7 @@ class InvitationEmail extends AbstractEmail /** * InvitationEmail constructor. - * @param UserInvited $invitationt + * @param UserInvited $invitation */ public function __construct(UserInvited $invitation) { $this->invitation = $invitation; @@ -29,11 +29,11 @@ class InvitationEmail extends AbstractEmail } private function invitationUrl(){ - return url(route('auth.registration', ['email' => $this->invitation->getInvitation()->email, 'hash' => $this->invitation->getInvitation()->hash])); + return url(route('auth.registration', ['email' => $this->invitation->getData()->email, 'hash' => $this->invitation->getData()->hash])); } private function senderName(){ - $sender = $this->invitation->getInvitation()->sender; + $sender = $this->invitation->getData()->sender; return $sender->first_name.' '.$sender->last_name; } diff --git a/resources/assets/vue/app.js b/resources/assets/vue/app.js index 0a37f2f..0e3e6a0 100644 --- a/resources/assets/vue/app.js +++ b/resources/assets/vue/app.js @@ -35,6 +35,7 @@ Vue.component('address-component', require('./components/form_elements/AddressCo //lists Vue.component('accounts-list-component', require('./components/account/lists/AccountsListComponent.vue')); +Vue.component('invite-account-list-component', require('./components/account/lists/AccountsInviteListComponent.vue')); Vue.component('companies-list-component', require('./components/company/lists/CompaniesListComponenet.vue')); @@ -49,6 +50,7 @@ Vue.component('orders-list-component', require('./components/order/lists/OrdersL //elements Vue.component('account-component', require('./components/account/elements/AccountComponent.vue')); +Vue.component('invite-account-component', require('./components/account/elements/AccountInviteComponent.vue')); Vue.component('company-profile-component', require('./components/company/elements/CompanyProfileComponenet.vue')); Vue.component('company-summary-component', require('./components/company/elements/CompanySummaryComponenet.vue'));