Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyn/Multi-tenant 5.3.1 Events not triggering User defined Listener in Laravel 5.7 #829

Closed
karmendra opened this issue Aug 8, 2019 · 2 comments
Labels
research support Question or generic support.

Comments

@karmendra
Copy link

Description
Hyn/Multi-tenant 5.3.1 Events not triggering User defined Listener in Laravel 5.7

I have following tenancy setup

in .env

TENANCY_DEFAULT_CONNECTION=mysql
LIMIT_UUID_LENGTH_32=true
TENANCY_DATABASE_DIVISION_MODE=bypass

.env is set like this to make sure to support single Database and to use auto-identification

Adding following lines in AppServiceProvider.php to trigger the Hyn Events

    public function boot()
    {
	    CustomValidationRules::init();
        $environment = $this->app->make(\Hyn\Tenancy\Environment::class);

        $website   = \Hyn\Tenancy\Facades\TenancyFacade::website();

        // Now switch the environment to a new tenant.
        $environment->tenant($website);
    }

I created a listener and updated the $listener array for mapping in EventServiceProvider.php

\Hyn\Tenancy\Events\Websites\Switched::class => [
            \App\Listeners\TenantConfigLoadListener::class
        ],

Actual behavior

All internal listeners belonging to Hyn Package are triggered, but \App\Listeners\TenantConfigLoadListener is not triggered.
..

Expected behavior

\App\Listeners\TenantConfigLoadListener is should be triggered when \Hyn\Tenancy\Events\Websites\Switched Event is triggered,
..


Information

  • hyn/multi-tenant version: 5.3
  • laravel version: 5.7
  • database driver and version: mysql 5.7
  • webserver software and version: laravel homestead 8
  • php version: 7.1

tenancy.php config

unchanged, using default

webserver.php config

unchanged, using default

@Plytas Plytas added research support Question or generic support. labels Jan 31, 2020
@Plytas
Copy link
Contributor

Plytas commented Jan 31, 2020

@karmendra Would you be able to share your repo, or create a fresh one where we could reproduce this issue?

@ArlonAntonius
Copy link
Member

Closing this issue due to inactivity.

If you feel like your issue has not been properly addressed yet, or if you still need more information, please reopen this issue 😄

If you require help with a different issue, please open a new issue.

You can also find Tenancy related help & resources on:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
research support Question or generic support.
Projects
None yet
Development

No branches or pull requests

3 participants