1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 18:24:04 +00:00
Commit graph

1097 commits

Author SHA1 Message Date
lukinovec
8deeef25be Improve tests 2023-01-06 08:34:56 +01:00
lukinovec
caa0c87153 Improve comment 2023-01-06 07:22:07 +01:00
lukinovec
1104aba4ef Improve specific cache store in a service test 2023-01-06 07:20:37 +01:00
lukinovec
d945d1facc Rename CacheManagerService 2023-01-06 07:17:55 +01:00
lukinovec
52db2a0c06 Remove group('prefix') 2023-01-05 16:49:49 +01:00
lukinovec
507df55b4c Update test name 2023-01-05 16:45:25 +01:00
lukinovec
5ea5299ed1 Make CacheService a singleton in a test 2023-01-05 16:37:43 +01:00
lukinovec
b38aee0a6a Remove unused import, change word 2023-01-05 16:28:33 +01:00
lukinovec
7f10b9af41 Make 'redis' the only tenant cache store in beforeEach, test that tenantCacheStores works 2023-01-05 16:24:37 +01:00
lukinovec
42381d00e2 Remove redundant CacheManager extend() call 2023-01-05 16:14:20 +01:00
lukinovec
30d73d2694 Change nonTenantCacheDrivers to tenantCacheStores 2023-01-05 16:13:00 +01:00
lukinovec
f8f0e1e5da
Merge branch 'master' into cache-prefix 2023-01-05 15:07:59 +01:00
lukinovec
ffefe1b45c Test that the prefix stays the same 2023-01-05 13:05:39 +01:00
lukinovec
86c388a2b6 Add nonTenantCacheDrivers check 2023-01-05 13:05:24 +01:00
lukinovec
4b0df42f8a Add and test nonTenantCacheDrivers 2023-01-05 12:47:03 +01:00
lukinovec
1c21c66913
Make $cache non-nullable
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2023-01-05 11:42:12 +01:00
lukinovec
a59d5a1069 Add test 2023-01-04 15:08:09 +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
lukinovec
8a54e19644 Revert changes, add comment 2022-12-22 09:41:45 +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
PHP CS Fixer
c9ba569e49 Fix code style (php-cs-fixer) 2022-12-16 10:13:00 +00:00
lukinovec
fa00fc7a28 Add changes to PR to Laravel 2022-12-16 11:12:33 +01:00
lukinovec
21dc69e358
Use invade in BootstrapperTest (#1033) 2022-12-15 15:03:03 +01:00
lukinovec
7092f4c856 Make CacheManager::$addTags default to true 2022-12-14 16:21:45 +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
87efdd2954 Toggle cache tags 2022-12-13 05:25:57 +01:00
lukinovec
5c6226befc Use better class for the macro 2022-12-12 17:31:05 +01:00
PHP CS Fixer
bc70a2fab8 Fix code style (php-cs-fixer) 2022-12-12 16:25:57 +00:00
lukinovec
35a3412011 Move Cache::macro() to a slightly more appropriate place 2022-12-12 17:25:29 +01:00
lukinovec
d3c7fef002 Revert condition in CacheManager to avoid excessive nesting 2022-12-12 17:16:53 +01:00
lukinovec
b41d8d19dc Uncomment cache tagging 2022-12-12 17:11:14 +01:00
PHP CS Fixer
3cadefd41c Fix code style (php-cs-fixer) 2022-12-12 16:07:21 +00:00
lukinovec
d364568e53 Update CacheManager, add refreshStore() 2022-12-12 17:06:49 +01:00
lukinovec
9ec0b6dae3 Make Tenancy override CacheManager 2022-12-12 17:05:53 +01:00
lukinovec
dc9c8fcf68 Simplify cache store refreshing 2022-12-12 16:58:40 +01:00
PHP CS Fixer
012a39f79d Fix code style (php-cs-fixer) 2022-12-09 11:22:03 +00:00
lukinovec
50d46139f6 Add macro 2022-12-09 12:21:37 +01:00
lukinovec
825a565fa2 Update prefix bootstrapper and test (setStore() in CacheManager and Repository needed) 2022-12-08 16:24:54 +01:00
lukinovec
4c33df1aa5 Rename CacheAction to CacheService 2022-12-07 14:48:52 +01:00
Abrar Ahmad
974414a12d Update CacheAction.php 2022-12-07 18:26:10 +05:00
Abrar Ahmad
19255fd98f use Repository in service class DI 2022-12-07 18:24:55 +05:00
Abrar Ahmad
2f91309990 introduce second tenant in test 2022-12-01 14:59:13 +05:00