1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 15:54:03 +00:00
Commit graph

1064 commits

Author SHA1 Message Date
lukinovec
2d2b3faaa8 Fix test 2023-01-30 15:07:24 +01:00
lukinovec
8eeefb74a0 Remove duplicate import 2023-01-30 15:05:03 +01:00
lukinovec
352b5d64b5
Merge branch 'master' into broadcasting-tenancy 2023-01-30 15:00:40 +01:00
Roman
3e13e62806
CachedTenantResolver missing cache case crash fix. (#1005)
* CachedTenantResolver missing cache case crash fix.

* Check if cached tenant is truthy

Co-authored-by: rty <rty@interlogic.com.ua>
Co-authored-by: lukinovec <lukinovec@gmail.com>
2023-01-18 18:46:47 +01:00
Samuel Štancl
21d55ef472 add setup-php to phpstan job 2023-01-06 02:44:37 +01:00
Samuel Štancl
48fc63fe02 switch to PHP 8.2 2023-01-06 02:38:31 +01:00
Samuel Štancl
24d71230e8 comment out php 8.2 phpstan ignores 2023-01-04 03:18:52 +01:00
Samuel Štancl
32a128d657 lower required php version back to 8.1 2023-01-04 03:08:56 +01:00
Samuel Štancl
db1dc334a6 add todo 2023-01-04 03:04:56 +01:00
Samuel Štancl
9078280a44 revert to 8.1 in CI for now 2023-01-04 03:04:00 +01:00
Samuel Štancl
da817cebe5 Merge branch 'master' of github.com:archtechx/tenancy 2023-01-04 02:43:24 +01:00
Samuel Štancl
d0dd87ab07 bump PHP to 8.2, minor ci fixes 2023-01-04 02:43:10 +01:00
PHP CS Fixer
d4c6c34e7c Fix code style (php-cs-fixer) 2023-01-04 01:24:21 +00:00
Samuel Štancl
03ac1ef127 fix phpstan errors (seems like it started ignoring @property annotations on interfaces and abstract classes) 2023-01-04 02:23:48 +01:00
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
Abrar Ahmad
f42f08cb87
Add session state when impersonating tenant (#1029)
* wip

* Fix code style (php-cs-fixer)

* Update TenantUserImpersonationTest.php

* renamed method

* update method name in test

* rename session key

* fix test

* Update src/Features/UserImpersonation.php

Co-authored-by: Samuel Štancl <samuel@archte.ch>

* Update UserImpersonation.php

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-12-17 02:08:03 +01:00
lukinovec
21dc69e358
Use invade in BootstrapperTest (#1033) 2022-12-15 15:03:03 +01:00
lukinovec
151a66b866 Fix PHPStan errors 2022-12-15 09:43:31 +01:00
lukinovec
bbe66fa055 Fix PHPStan errors 2022-12-15 09:15:19 +01:00
lukinovec
eb1d6e0bf8 Add comment 2022-12-15 09:10:51 +01:00
lukinovec
b78a925f19 Simplify BroadcastManager extension, remove setDriver method 2022-12-15 09:06:43 +01:00
lukinovec
cfb7e9674c Add BroadcastTenancyBootstrapper comments 2022-12-15 07:47:52 +01:00
lukinovec
85680622f4 Add comments to TenancyBroadcastManager 2022-12-15 07:39:01 +01:00
Abrar Ahmad
68de3600bd
Improve commands CLI output (#1030)
* use component info/error methods

* Update src/Commands/ClearPendingTenants.php

Co-authored-by: lukinovec <lukinovec@gmail.com>

Co-authored-by: lukinovec <lukinovec@gmail.com>
2022-12-14 15:08:00 +01:00
lukinovec
76fa668429 Fix BroadcastingTest 2022-12-14 12:15:06 +01:00
lukinovec
aa2fcdf9bc Clean up BootstrapperTest 2022-12-14 12:00:32 +01:00
lukinovec
6b066f8496 Add broadcaster channels test 2022-12-14 11:27:25 +01:00
lukinovec
ab009d3679 Add bootstrapper test 2022-12-13 12:39:11 +01:00
PHP CS Fixer
cc82d60903 Fix code style (php-cs-fixer) 2022-12-13 11:26:06 +00:00
lukinovec
09f8181245 Separate the test 2022-12-13 12:25:39 +01:00
lukinovec
a79796f612 Add BroadcastTenancyBootstrapper tests 2022-12-13 12:04:52 +01:00
lukinovec
60911aabad Instead of just forgetting the old broadcaster instance, bind the new one 2022-12-13 11:59:23 +01:00
lukinovec
14333a253d Bind the original broadcaster instance on revert() 2022-12-13 11:55:06 +01:00
PHP CS Fixer
9ac0af29aa Fix code style (php-cs-fixer) 2022-12-09 11:47:02 +00:00
lukinovec
2c6a568b5e Make BroadcastTenancyBootstrapper a singleton in tests 2022-12-09 12:46:36 +01:00
lukinovec
52d3ebcff9 Fix property type 2022-12-09 12:45:59 +01:00
lukinovec
4b33b8620c Move manager to correct directory 2022-12-09 12:38:40 +01:00
PHP CS Fixer
410841dfe8 Fix code style (php-cs-fixer) 2022-12-07 13:28:10 +00:00
lukinovec
2ed918406d Bind original BroadcastManager again on revert() 2022-12-07 14:27:43 +01:00
PHP CS Fixer
fea370d813 Fix code style (php-cs-fixer) 2022-12-07 09:15:19 +00:00
lukinovec
9834684402 Add BroadcastTenancyBootstrapper and TenancyBroadcastManager 2022-12-07 09:38:44 +01:00
lukinovec
7d3298c6bb
Improve code of pending tenants (#1025)
* Remove `--all` option from ClearPendingTenants

* Improve query formatting

* Remove redundant test

* Convert time constrait options to int

* Improve CreatePendingTenants success message
2022-11-29 09:31:07 +01:00
Abrar Ahmad
73c5655bc8
Manual mode improvements (use correct event type, add new listeners) (#1013)
* fix issue and add test

* Update CreateTenantConnection.php

* add purge call

* Update ManualModeTest.php

* use tenant connection and central connection listener

* Update ManualModeTest.php

* fix test

* improvements

* Update ManualModeTest.php

* add comment

* simplify comment

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-11-25 03:09:31 +01:00
lukinovec
ea19117870
Use the hardcoded default path in TenantDump only if the path isn't configured (#1019)
* Use the hardcoded tenant dump path only if the path isn't configured

* Test generating tenant dump at the configured path
2022-11-23 13:12:29 +01:00
lukinovec
cb7567a88a
[4.x] Make TenantDump work when called outside the tenant context (#1015)
* Run TenantDump as passed tenant

* Fix code style (php-cs-fixer)

* Fix `tenants:dump` tests

* Update dump command test

* Remove redundant `tenant-schema.dump` unlinking

* Delete duplicate test

* Update test name

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2022-11-23 08:38:20 +01:00
lukinovec
9520cbc811
Only delete tenants in MigrateFreshOverride if the tenants table exists (#1007)
* Don't drop tenant databases on `migrate:fresh` if the tenants table doesn't exist

* Fix code style (php-cs-fixer)

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2022-11-18 15:58:04 +01:00
Samuel Štancl
1db2f0913f add todo 2022-11-17 03:39:57 +01:00
Abrar Ahmad
fb2369dc11
anonymous publishable migrations (#1001) 2022-11-11 13:02:13 +01:00
Samuel Štancl
2a39b0526a Fix #998, properly replace ALL tenant_id literals 2022-11-10 16:44:52 +01:00
Samuel Štancl
8a00a105d0 Merge branch 'master' of github.com:archtechx/tenancy 2022-11-10 16:03:28 +01:00