repository = $repository; } /** * @param UserInvitationObject $object * @return UserInvitation|null * @throws ResourceConflictException */ public function execute(UserInvitationObject $object): ?UserInvitation { $this->repository->email = $object->getInviteeEmail(); $this->repository->hash = $object->getHash(); $this->repository->role_id = $object->getRole(); $this->repository->sender_id = auth()->user()->getAuthIdentifier(); $this->repository->is_complete = false; $this->repository->save(); return $this->repository; } }