* Replace MailManager singleton with an instance of a custom mail manager which always resolves the mailers instead of getting the cached ones
* Fix code style (php-cs-fixer)
* Add MailTenancyBootstrapper
* Add MailTenancyBootstrapper to tenancy.bootstrappers config (commented out)
* Fix code style (php-cs-fixer)
* Make credentials map a public static property
* Always resolve only the mailers specified in the mailersToNotCache public static property
* Fix typo in comment
* Update TenancyServiceProvider comment
* add todo
* Add comments to TenancyMailManager, rename property
* Remove the configKey array check
* Simplify bootstrap method
* Change $credentialsMap so that config keys are the keys, and the tenant property names are the values
* Rename $mailersToAlwaysResolve to $tenantMailers
* Update comment
* Update comment
* Rename variable in TenancyServiceProvider comment
* Scaffold tests
* Update comments after review
* Uncomment MailTenancyBootstrapper in config
* Use array_key_exists instead of null check
* Split config logic into methods
* Update mapping credentials
* Add tests for the added logic
* Fix code style (php-cs-fixer)
* Delete default 'smtp' mailer in $tenantMailers
* Add separate method to pick the appropriate mail credentials map preset
* Specify test name
* Move mail bootstrapper tests to BootstrapperTest
* Depend less on the default mailer by adding a static `$mailer` property
* Use static property for map presets
* Comment out MailTenancyBootstrapper from config
* Add return types to MailTenancyBootstrapper methods
* Update test name
* Move MailManager extension to MailTenancyBootstrapper
* Fix code style (php-cs-fixer)
* Update config reverting test
* Use `invade()` instead of ReflectionClass
* Fix constructor parameter formatting
* Delete TenancyMailManager, update tests
* Add return type
* Update comment
* Update MailTest
* Delete `group('mailer')`
* Delete bindNewMailManagerInstance()
* Delete remaining `group('mailer')`
* Fix comment
* Fix comment
Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
* Add SessionTenancyBootstrapper
* Fix code style (php-cs-fixer)
* add value to bootstrappers config
* tenant aware call test
* reproduce issue in tests
* fix logic for calling tenant run from central context, finish tests
* change laravel version back
* bump laravel to ^9.38
* add listener to create tenant DBs
Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
* wip
* Improve tests
* rename class
* wip
* improve tests
* introduce early identification middlewares
* Update PreventAccessFromCentralDomains.php
* method rename
* method rename
* Update UniversalRouteTest.php
* Update UniversalRouteTest.php
* Update EarlyIdentificationTest.php
* remove early classes and add check in existing classes
* MWs improvements
* Update UniversalRouteTest.php
* Fix code style (php-cs-fixer)
* trigger ci
* fix failing test after merge
* add test for universal route in early identification
* Update InitializeTenancyByDomain.php
* Update UniversalRouteTest.php
* remove `routeHasMiddleware` method from MW and use the UniversalRoutes class method
* helper dockblock
* add test
* handle universal routes in early identification
* remove UniversalRoute class because we are not using it anymore
* rename class from PreventAccessFromCentralDomains to PreventAccessFromUnwantedDomains
* improvements after self review
* Update PreventAccessFromUnwantedDomains.php
* remove inline class namespaces
* remove DomainTenant class and use the Tenant class
* update comment
* removed custom expection and add method
* Update tests/EarlyIdentificationTest.php
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
* use ltrim and simplify the comment
* remove comments and typhint
* dataset and keys rename
* rename $route parameter
* removed helper functions
* fix style
* Update InitializeTenancyByPath.php
* Update tests/EarlyIdentificationTest.php
* code style
* improve subdomain test
* use TenancyInitialized event and remove DomainTenant alias
* remove comment and move expectException below
* code style
* use TenancyInitialized event
* improve test
* improve datasets
* Initialized -> Initializing
* Update InitializeTenancyByPath.php
* remove todo
* Fix code style (php-cs-fixer)
* refactor helper method
* Update UniversalRouteTest.php
* add note above test
* remove after each hook
* renamed universal_middleware to global_middleware
* remove helper and improve url names
* change check position
* Revert "change check position"
This reverts commit e4371d2f3aa8ad7ae5e5b7d15781b72a5f1be03c.
* repositioned central check
* add comment
Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>