1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 22:14:03 +00:00
Automatic multi-tenancy for Laravel. No code changes needed. https://tenancyforlaravel.com
Find a file
lukinovec 0f892f1585
Make tenants able to have custom mail credentials (#989)
* 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>
2023-01-04 02:12:25 +01:00
.github [4.x] [WIP] Add phpstan to CI (#928) 2022-11-08 13:47:24 +01:00
art Update artwork 2020-06-09 15:36:47 +02:00
assets Make tenants able to have custom mail credentials (#989) 2023-01-04 02:12:25 +01:00
src Make tenants able to have custom mail credentials (#989) 2023-01-04 02:12:25 +01:00
tests Make tenants able to have custom mail credentials (#989) 2023-01-04 02:12:25 +01:00
.gitattributes Rewrite cached resolver logic to allow for cache invalidation logic 2020-06-02 20:10:17 +02:00
.gitignore [4.x] Add pending tenants (modified #782) (#869) 2022-10-31 12:14:44 +01:00
.php-cs-fixer.php [4.x] Add command to bring the tenants up and down from maintenance and remove deprecated exception (#761) 2022-09-29 15:59:14 +02:00
composer.json [4.x] [WIP] Add phpstan to CI (#928) 2022-11-08 13:47:24 +01:00
CONTRIBUTING.md Fix #998, properly replace ALL tenant_id literals 2022-11-10 16:44:52 +01:00
docker-compose-m1.override.yml Better M1 DX 2022-07-22 22:29:56 +02:00
docker-compose.yml add mssql health checks (#939) 2022-09-08 18:18:59 +02:00
Dockerfile misc improvements - stronger types, exception refactor 2022-08-26 21:35:17 +02:00
DONATIONS.md update md files 2020-06-08 22:42:13 +02:00
LICENSE Initial commit 2019-01-17 22:24:12 +01:00
phpstan.neon resolve all phpstan issues 2022-11-08 13:34:04 +01:00
phpunit.xml fix #854 2022-10-01 17:59:33 +02:00
README.md Update README.md 2022-05-01 12:56:25 +02:00
SUPPORT.md Discord link 2022-06-13 19:16:35 +02:00
t [4.x] Add feature to ignore the resource synchronization based on provided condition. (#993) 2022-11-04 15:04:29 +01:00
test [4.x] Migrate tests to Pest (#884) 2022-07-22 19:26:59 +02:00

Tenancy for Laravel logo

Laravel 9.x Latest Stable Version GitHub Actions CI status Donate

Tenancy for Laravel — stancl/tenancy

Automatic multi-tenancy for your Laravel app.

You won't have to change a thing in your application's code.

  • ✔️ No model traits to change database connection
  • ✔️ No replacing of Laravel classes (Cache, Storage, ...) with tenancy-aware classes
  • ✔️ Built-in tenant identification based on hostname (including second level domains)

Documentation

Documentation can be found here: https://tenancyforlaravel.com/docs/v3/

The repository with the documentation source code can be found here: stancl/tenancy-docs.

Need help?

Credits