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

1055 commits

Author SHA1 Message Date
Abrar Ahmad
4bdcf64c20 use correct key 2022-12-06 12:02:25 +05:00
Abrar Ahmad
dc69a112eb Merge branch 'master' into poly-sync 2022-12-06 11:35:40 +05:00
Abrar Ahmad
45106cd770 revert type 2022-12-05 17:31:25 +05:00
PHP CS Fixer
fa221652da Fix code style (php-cs-fixer) 2022-12-05 07:02:58 +00:00
Abrar Ahmad
2adef1ac45 use BelongsToMany for tenants method return type 2022-12-05 12:02:26 +05:00
Abrar Ahmad
f99a8222c9 remove getResourceTenantModelName method and use config 2022-12-02 10:23:26 +05:00
Abrar Ahmad
b25071323f improve assertions 2022-12-01 15:05:22 +05:00
Abrar Ahmad
ea3e90987b improve tenants assertions 2022-12-01 13:13:32 +05:00
Abrar Ahmad
fb847830d5 Update ResourceSyncingUsingPolymorphicTest.php 2022-12-01 13:07:57 +05:00
Abrar Ahmad
4f9b8be2c1 Assert tenants are accessible 2022-11-30 16:33:38 +05:00
Abrar Ahmad
86469dd357 use unset approach 2022-11-30 16:05:28 +05:00
Abrar Ahmad
53d5ffb3b4 use unset approach 2022-11-30 15:40:24 +05:00
Abrar Ahmad
144df028a0 revert to unset change 2022-11-30 15:21:50 +05:00
Abrar Ahmad
1a67300615 add back using statement 2022-11-30 13:36:36 +05: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
b99fcc28fd trait 2022-11-14 11:14:54 +05:00
Abrar Ahmad
306a0a7204 rename classes 2022-11-14 11:02:22 +05:00
Abrar Ahmad
1f730e2582 rename file 2022-11-14 10:51:37 +05:00
Abrar Ahmad
fb2369dc11
anonymous publishable migrations (#1001) 2022-11-11 13:02:13 +01:00
Abrar Ahmad
e2ca635ff8 anonymous migration for tenant_resources table 2022-11-11 11:21:20 +05: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
Samuel Štancl
dd0f03f742 Fix #998, centralize config used by BelongsToTenant and HasDomains 2022-11-10 16:03:13 +01:00
Abrar Ahmad
aa958ce930 use resource migrations from asset 2022-11-10 15:55:56 +05:00
Abrar Ahmad
f420df09aa Merge branch 'master' into poly-sync 2022-11-10 14:44:49 +05:00
Abrar Ahmad
9e76964df4 remove unsed import 2022-11-10 14:37:35 +05:00
Abrar Ahmad
cd24aa779d ability to publish migrations 2022-11-10 14:37:11 +05:00
Abrar Ahmad
b08961150c separate pivot model for each approach 2022-11-10 14:36:58 +05:00
Abrar Ahmad
dfe1fcecb5 use BelongsToMany return type 2022-11-10 14:36:27 +05:00
Abrar Ahmad
ea3e44576f
[4.x] Resource syncing improvements (#992)
* Update TenantSyncingTest.php

* Update ResourceSyncingTest.php

* rename UserTenant to ResourceTenant

* Revert "rename UserTenant to ResourceTenant"

This reverts commit f9ba778e1b.

* rename TenantUser class

* return style

* Update ResourceSyncingTest.php

* revert return style

* Update ResourceSyncingTest.php
2022-11-09 13:00:54 +01:00
Abrar Ahmad
d5d12d1014 Update ResourceSyncingPolymorphicTest.php 2022-11-09 16:25:39 +05:00
Abrar Ahmad
eae2bd607c correct method name 2022-11-09 15:33:38 +05:00
Abrar Ahmad
99dd862b20
[4.x] [WIP] Add phpstan to CI (#928)
* add phpstan

* resolve phpstan issue from CI

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-11-08 13:47:24 +01:00
Samuel Štancl
942d79cbd7 resolve all phpstan issues 2022-11-08 13:34:04 +01:00
Abrar Ahmad
01a3a5fbab Update SyncMaster.php 2022-11-08 17:22:23 +05:00
Abrar Ahmad
14dfbd4528 Update ResourceSyncingPolymorphicTest.php 2022-11-08 16:41:02 +05:00
Abrar Ahmad
2a19f3dc07 Merge branch 'poly-sync' of https://github.com/abrardev99/tenancy into poly-sync 2022-11-08 15:47:01 +05:00
Abrar Ahmad
f9dc4cb8e0 adjust tests 2022-11-08 15:46:59 +05:00
PHP CS Fixer
8001cbc0af Fix code style (php-cs-fixer) 2022-11-08 09:49:33 +00:00
Abrar Ahmad
8c81ef2a8d wip 2022-11-08 14:49:01 +05:00
Samuel Štancl
b7a6953231 mention ./t in CONTRIBUTING.md 2022-11-04 15:17:54 +01:00
Abrar Ahmad
22d1b2065b
[4.x] Add feature to ignore the resource synchronization based on provided condition. (#993)
* wip

* add test

* readability

* remove group

* DisabledSync -> ConditionalSync; test both cases with dataset

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-11-04 15:04:29 +01:00
Abrar Ahmad
77c5ae1f32
[4.x] Configure attributes for synced resources when creating models (#915)
* configure attributes for creating resource

* Update ResourceSyncingTest.php

* Update ci.yml

* Update ResourceSyncingTest.php

* Update ci.yml

* cs

* comments

* Update tests/ResourceSyncingTest.php

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

* improve comments, move method to `SyncMaster` interface

* Revert "improve comments, move method to `SyncMaster` interface"

This reverts commit 5ddd50deb9.

* Update ResourceSyncingTest.php

* Update ResourceSyncingTest.php

* update comment

* Update ResourceSyncingTest.php

* Update ResourceSyncingTest.php

* wip

* wip

* wip

* add a todo

* assert that creation attributes returns null

* classes at the end

* rename method to `getAttributesForCreation`

* Update ResourceSyncingTest.php

* update comments

* Fix little grammer

* merge default values with sync attributes and tests

* Update ResourceSyncingTest.php

* method rename

* method rename

* Update ResourceSyncingTest.php

* comments

* Update ResourceSyncingTest.php

* allow defining a mix of attribute names and default values

* add test

* code improvements

* Fix code style (php-cs-fixer)

* remove unused import

* fix all phpstan issues in resource syncing code

* Fix code style (php-cs-fixer)

* wip

* improve tests

* Update ResourceSyncingTest.php

* better names

* Update UpdateSyncedResource.php

* code style

* Update UpdateSyncedResource.php

* add comments above new tests

* methods dockblocks and correct names

* Update ResourceSyncingTest.php

* update comments

* remove different schema setup

* delete custom migrations

* self review

* grammar, code style

* refactor helpers for creating tenants

Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2022-11-03 17:51:29 +01:00
Samuel Štancl
aa536529df
update DatabaseSeeder namespace 2022-11-01 17:48:56 +01:00
Samuel Štancl
0fd54bd685 Merge branch 'master' of github.com:archtechx/tenancy 2022-11-01 12:47:24 +01:00