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

17 commits

Author SHA1 Message Date
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
Samuel Štancl
dd0f03f742 Fix #998, centralize config used by BelongsToTenant and HasDomains 2022-11-10 16:03:13 +01:00
Samuel Štancl
ccaba05272 Add identification section to config, refactor static properties 2022-10-01 20:01:18 +02:00
Samuel Štancl
87212e5390 phpstan, global_cache, resolver improvements, InitializationHelpers trait 2022-09-29 02:47:13 +02:00
Samuel Štancl
8af354c20e get phpstan errors down from 252 to 189 2022-08-30 05:44:23 +02:00
Samuel Štancl
d2e1ce0a1e refactor TenantDatabaseManagers 2022-08-27 22:29:08 +02:00
Samuel Štancl
55d0a9ab87 misc improvements - stronger types, exception refactor 2022-08-26 21:35:17 +02:00
Ralfs
c21beabd3e
Fix issue 632: cached lookup (#633)
* Instead of querying Domain model, find Tenant and eager load it's domain via Tenant model. Fixed cached lookup issue - when caching Tenant, also include the current Domain, so it can be later accessed via $tenant->domains->first() (even, when using multiple domains per tenant). Added tenantIdentifiedFromCache method in CachedTenantResolver.php, which can be used to set custom properties in resolvers after Tenant is loaded from cache.

* StlyeCi Fix - removed PHP 8 nullsafe operator for compatibility with older PHP versions, replaced with inline if

* Redundant variable '$domain', because $tenant is not null, only, when current domain is found and relationship is loaded (with only one domain).

* Fixed tenant()->domains showing incorrect data. Renamed tenantIdentifiedFromCache() method and removed duplicate code, when setting current domain.

* Removed select() for better flexibility, added new method setCurrentDomain(), refactored the usage of tenantIdentified().

* rename method to resolved()

* clean up code

* StyleCi Fix

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2021-04-16 19:57:41 +02:00
Samuel Štancl
057ddcbbae Better exception from DomainTenantResolver 2020-06-28 13:53:33 +02:00
Samuel Štancl
7bdbc082cc Set static property on domain resolver 2020-06-28 12:21:05 +02:00
Samuel Štancl
02e049b59e Convert domains to lowercase, persist current domain model on resolver 2020-06-28 11:45:08 +02:00
Samuel Štancl
ba7257670f Add check to invalidateCache() 2020-06-02 20:26:17 +02:00
stancl
6955512a6b Apply fixes from StyleCI 2020-05-22 09:01:31 +00:00
Samuel Štancl
8ea4940f34 Identification middleware & tests 2020-05-10 05:47:27 +02:00
Samuel Štancl
5e6d82be57 path identification wip 2020-05-09 03:56:41 +02:00
Samuel Štancl
e1a4054743 Domain model & resolver test 2020-05-08 18:16:18 +02:00