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

1182 commits

Author SHA1 Message Date
Samuel Štancl
a006e49881
specify version of odbc libraries 2023-02-16 17:20:55 +01:00
lukinovec
e11a71e421 Use Laravel fork in ci.yml 2023-02-02 11:16:45 +01:00
lukinovec
93aaba3e11 Merge branch 'master' of github.com:archtechx/tenancy into cache-prefix 2023-02-02 10:51:09 +01:00
Abrar Ahmad
758fbc8a75
Use polymorphic table for mapping resources to tenants (#997)
* wip

* Fix code style (php-cs-fixer)

* adjust tests

* Update ResourceSyncingPolymorphicTest.php

* Update SyncMaster.php

* correct method name

* Update ResourceSyncingPolymorphicTest.php

* use BelongsToMany return type

* separate pivot model for each approach

* ability to publish migrations

* remove unsed import

* use resource migrations from asset

* anonymous migration for `tenant_resources` table

* rename file

* rename classes

* trait

* add back using statement

* revert to unset change

* use unset approach

* use unset approach

* Assert `tenants` are accessible

* Update ResourceSyncingUsingPolymorphicTest.php

* improve `tenants` assertions

* improve assertions

* remove `getResourceTenantModelName` method and use config

* use `BelongsToMany` for `tenants` method return type

* Fix code style (php-cs-fixer)

* revert type

* use correct key

* test right resources are accessible from the tenant

* Update tests/ResourceSyncingUsingPolymorphicTest.php

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2023-02-02 06:39:35 +01:00
lukinovec
c3e3a33ed0 Fix test 2023-02-01 11:51:28 +01:00
PHP CS Fixer
9ed7308754 Fix code style (php-cs-fixer) 2023-02-01 10:33:33 +00:00
lukinovec
95170312ea Fix types 2023-02-01 11:33:09 +01:00
Abrar Ahmad
087733d5db
Allow defining the tenant connection template using array syntax in config (#1040)
* `template_tenant_connection` can be array or string

* Update TenantDatabaseManagerTest.php

* Update TenantDatabaseManagerTest.php

* Update TenantDatabaseManagerTest.php

* Update DatabaseConfig.php

* partial database config for template

* Update tests/TenantDatabaseManagerTest.php

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

* update test name

* improve test names

* add comments

---------

Co-authored-by: lukinovec <lukinovec@gmail.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2023-02-01 07:02:03 +01:00
lukinovec
cc9928bc34 Hint Repository implementation instead of contract 2023-02-01 07:01:52 +01:00
lukinovec
342c67fe02
Add skip-failing option to the Migrate command (#945)
* Add and test Migrate command's skip-failing option

* Improve naming

* Move migration event dispatching inside try block

* Change test name

* Fix skip-failing test

* Use QueryException instead of Exception

* Correct TenantDatabaseDoesNotExistException import

* Correct test

* Check for the the testing env in DB bootstrapper

* Correct the Migrate command

* Fix code style (php-cs-fixer)

* add docs todo

* Add QueryException to the Migrat command try/catch

* Return status codes in Migrate

* Fix code style (php-cs-fixer)

* Add test for not stopping tenants:migrate after the first failure

* Update Migrate command

* Fix code style (php-cs-fixer)

* Fix code style (php-cs-fixer)

* Use `getTenants()`

* Use withtenantDatabases where needed

* Add withTenantDatabases to test

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2023-02-01 06:55:26 +01:00
Samuel Štancl
d7437c42d2 Merge branch 'master' of github.com:tenancy-for-laravel/v4 2023-02-01 06:20:27 +01:00
lukinovec
bd6332f0e6 Upgrade Laravel 2023-02-01 06:20:27 +01:00
Samuel Štancl
f741f44527 Merge branch 'master' of github.com:archtechx/tenancy 2023-02-01 06:17:27 +01:00
Samuel Štancl
0a205dd817 resolve phpstan issues 2023-02-01 06:17:19 +01:00
PHP CS Fixer
7767fea5ba Fix code style (php-cs-fixer) 2023-02-01 05:05:50 +00:00
Samuel Štancl
66c7d6a066 fix PhpParser exception 2023-02-01 06:05:26 +01:00
lukinovec
9b36bf29ce Downgrade Laravel 2023-01-31 08:21:27 +01:00
lukinovec
ba8cfdda85
Merge branch 'master' into cache-prefix 2023-01-31 08:17:22 +01:00
PHP CS Fixer
a4aa499269 Fix code style (php-cs-fixer) 2023-01-31 07:13:35 +00:00
lukinovec
62a2ed163c Use my Laravel fork 2023-01-31 08:13:06 +01:00
PHP CS Fixer
864add9ade Fix code style (php-cs-fixer) 2023-01-31 03:00:43 +00:00
Samuel Štancl
5ceee3b9b4 Merge branch 'master' of github.com:archtechx/tenancy 2023-01-31 04:00:11 +01:00
Samuel Štancl
c74a7b6fd4 remove debuggable trait, update larastan 2023-01-31 03:59:33 +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
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
Samuel Štancl
87c08cebc4 Merge branch 'master' of github.com:archtechx/tenancy 2023-01-06 02:48:40 +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
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
a0256fd5f3 Merge branch 'master' of github.com:archtechx/tenancy 2023-01-04 03:27:04 +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