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

14 commits

Author SHA1 Message Date
Samuel Štancl
0c11f29c19
Resolver refactor, path identification improvements (#41)
* resolver refactor

* Fix code style (php-cs-fixer)

* make tenant column used in PathTenantResolver configurable, fix phpstan errors, minor improvements

* support binding route fields, write tests for customizable tenant columns

* Invalidate cache for all possible columns in path resolver

* implement proper cache separation logic for different columns used by PathTenantResolver

* improve return type

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2024-03-28 03:18:11 +01:00
lukinovec
aa1437fb5e
Resolve misc to-dos (#26)
* Resolve delete tenant storage todo

* Delete outdated todo (resolved in #25)

* Delete resource syncing todo (resolved in #11)

* Make it clear that getArgsForTenant() is used during cache invalidation

* Delete redundant __call() and __callStatic() annotations

* Fix code style (php-cs-fixer)

* Revert %tenant_id% to-do removal

* Test all cached resolvers instead of just the domain one

* Make docblock more concise, delete renaming to-do (the name seems fine)

* Fix method in tests

* If route is the only resolver arg, use the tenant as the cache key instead of encoded route instance

* Resolve to-do

* make docblock more clear

* Add comments to getResolverArgument()

* Rename $id to $tenantKey

* Fix code style (php-cs-fixer)

* Add regression test for forgetting tenant parameters of cached tenants

* Forget route parameter when tenant gets resolved

* Add parameter type

* Simplify getCacheKey()

* Resolvers wip

* Resolvers wip

* Fix code style (php-cs-fixer)

* Bring back the route instance check to getCacheKey, fix test

* add todo

* add assertion

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2024-02-10 18:38:05 +01:00
Samuel Štancl
ccaba05272 Add identification section to config, refactor static properties 2022-10-01 20:01:18 +02:00
Samuel Štancl
f9c9d8615f Refactor tests to use pest() helper 2022-07-23 01:16:50 +02:00
Samuel Štancl
b47c5549ef
[4.x] Migrate tests to Pest (#884)
* Add Pest dependencies

* Add base Pest file

* Convert test cases

* Remove non-compound imports

* Adopt expectation API

* Optimize uses

* Shift cleanup

* phpunit -> pest

* Fix tests in PR #884 PHPUnit to Pest Converter  (#885)

* fixed tests, remove method duplications, restore necessary inner classes

* Update CommandsTest.php

* temporary checks run on `shift-64622` on branch.

* fixed `TestSeeder` class not resolved

* fixed messed up names

* removed `uses` from individual files and add it in `Pest`

* extract tests to helpers

* use pest dataset

* Update AutomaticModeTest.php

* newline

* todo convention

* resolve reviews

* added `// todo@tests`

* remove shift branch from CI workflow

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

* check if I have write permission

* Convert newly added tests to Pest

Co-authored-by: Shift <shift@laravelshift.com>
Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
2022-07-22 19:26:59 +02:00
Samuel Štancl
405a137ca1 Better solution for tenant DB exception 2020-06-29 12:18:03 +02:00
Samuel Štancl
41aead5da2 Revert "Get rid of TenantDatabaseDoesNotExist exception"
This reverts commit fe52a3c4ea.
2020-06-29 12:14:58 +02:00
Samuel Štancl
fe52a3c4ea Get rid of TenantDatabaseDoesNotExist exception 2020-06-29 09:58:37 +02:00
stancl
e1c79bab11 Apply fixes from StyleCI 2020-06-02 18:26:37 +00:00
Samuel Štancl
ba7257670f Add check to invalidateCache() 2020-06-02 20:26:17 +02:00
stancl
f639909eb7 Apply fixes from StyleCI 2020-05-22 10:34:35 +00:00
Samuel Štancl
800e8d5a56 Enable caching in initialization mw 2020-05-22 12:34:25 +02:00
stancl
6955512a6b Apply fixes from StyleCI 2020-05-22 09:01:31 +00:00
Samuel Štancl
d7536ce0af CachedTenantResolver 2020-05-20 20:34:16 +02:00