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

1055 commits

Author SHA1 Message Date
lukinovec
6222a72a2f Merge branch 'master' of https://github.com/archtechx/tenancy into stein-j-readied-tenant 2022-10-05 13:42:38 +02:00
lukinovec
af689f816a Make with-pending VALUE_NONE 2022-10-05 13:35:23 +02:00
lukinovec
72f742e53d Test using --with-pending and the include_in_queries config value 2022-10-05 10:23:40 +02:00
lukinovec
e3e85a0e88 Add optionNotPassedValue property 2022-10-05 10:18:56 +02:00
Samuel Štancl
6ee93d0441 update comment about middleware order 2022-10-01 20:02:13 +02:00
Samuel Štancl
ccaba05272 Add identification section to config, refactor static properties 2022-10-01 20:01:18 +02:00
Samuel Štancl
e5bc8ddb77 add tenantIdColumn() method (refactor previous commit) 2022-10-01 18:01:39 +02:00
Samuel Štancl
24146b26e2 fix #854 2022-10-01 17:59:33 +02:00
PHP CS Fixer
ed4632142b Fix code style (php-cs-fixer) 2022-09-30 13:02:40 +00:00
lukinovec
040c42d325 Add and use getWithPendingOption method 2022-09-30 15:02:05 +02:00
lukinovec
09bb5326c7 Remove duplicate tenancy bootstrappers config setting 2022-09-30 11:21:44 +02:00
PHP CS Fixer
efd5238831 Fix code style (php-cs-fixer) 2022-09-30 09:10:39 +00:00
lukinovec
a346ec450e Remove tenant ordering 2022-09-30 11:10:03 +02:00
PHP CS Fixer
b211cf1caf Fix code style (php-cs-fixer) 2022-09-30 08:39:18 +00:00
lukinovec
75ce19e4a9
Make createPending() return the created tenant 2022-09-30 10:38:43 +02:00
lukinovec
7a0eaeb007 Make with-pending default to config('tenancy.pending.include_in_queries') in HasTenantOptions 2022-09-30 10:19:31 +02:00
lukinovec
bd8a1aa2ce Remove redundant passing of $withPending to runForMultiple in TenantCollection's runForEach 2022-09-30 10:16:47 +02:00
lukinovec
1e04835536 Fix test name typo 2022-09-30 10:04:51 +02:00
lukinovec
0005f0eaa7 Use HasTenantOptions instead of the old trait name in Up/Down commands 2022-09-30 09:46:55 +02:00
Samuel Štancl
065b029f48 fix phpstan issues in FilesystemTenancyBootstrapper 2022-09-30 00:11:47 +02:00
Samuel Štancl
137d80a20c Merge branch 'master' of github.com:archtechx/tenancy 2022-09-29 23:40:41 +02:00
Samuel Štancl
f98a901aeb get down to 21 phpstan errors 2022-09-29 23:39:35 +02:00
PHP CS Fixer
a08480f310 Fix code style (php-cs-fixer) 2022-09-29 20:21:29 +00:00
Samuel Štancl
a94227a19c get down to 59 phpstan errors 2022-09-29 22:20:55 +02:00
Samuel Štancl
193e044777 remove remaining version checks 2022-09-29 16:02:40 +02:00
Samuel Štancl
fa09e3a083 remove version checks 2022-09-29 16:02:08 +02:00
Samuel Štancl
0d1a85005d
Merge branch 'master' into stein-j-readied-tenant 2022-09-29 16:01:24 +02:00
Jori Stein
121370ea01
[4.x] Add command to bring the tenants up and down from maintenance and remove deprecated exception (#761)
* Add bring up from maintenance function

* Add up and down tenant maintenance commands

* Rename commands signatures

* Update TenancyServiceProvider.php

* Complying to Laravel maintenance code and parameters

* Update MaintenanceModeTest.php

* Add maintenance mode via commands test

* Update CheckTenantForMaintenanceMode.php

* Update MaintenanceModeTest.php

* Cookie bypass only for > Laravel 8

* minor formatting change, trigger CI

* clean

* Update MaintenanceModeTest.php

* Add comments for using the 'tenants' option in runForMultiple

* improve code

* php-cs-fixer

* fix php cs fixer config

* improve test logic

* remove version check since v4 will be L9+

Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: lukinovec <lukinovec@gmail.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-09-29 15:59:14 +02:00
PHP CS Fixer
e009f6700c Fix code style (php-cs-fixer) 2022-09-29 13:08:06 +00:00
Samuel Štancl
2de182a260 Merge branch 'master' of github.com:archtechx/tenancy 2022-09-29 15:07:42 +02:00
Samuel Štancl
d463e2da61 phpstan improvements 2022-09-29 15:07:16 +02:00
PHP CS Fixer
19ed7d94c5 Fix code style (php-cs-fixer) 2022-09-29 08:31:07 +00:00
lukinovec
d1a88f57b7 Add missing imports 2022-09-29 10:30:44 +02:00
lukinovec
a28dba2c60 Fix formatting issue 2022-09-29 10:23:02 +02:00
lukinovec
a70b143859
Merge branch 'master' into stein-j-readied-tenant 2022-09-29 10:10:09 +02:00
PHP CS Fixer
dd952c727f Fix code style (php-cs-fixer) 2022-09-29 08:04:15 +00:00
lukinovec
0ee54da29c Correct the tenant order in Run command 2022-09-29 10:03:45 +02:00
PHP CS Fixer
77b5e508d6 Fix code style (php-cs-fixer) 2022-09-29 00:47:38 +00:00
Samuel Štancl
87212e5390 phpstan, global_cache, resolver improvements, InitializationHelpers trait 2022-09-29 02:47:13 +02:00
Samuel Štancl
fd65cf1754 add todo 2022-09-28 16:35:10 +02:00
lukinovec
cd37528399
Merge branch 'master' into stein-j-readied-tenant 2022-09-28 10:17:12 +02:00
lukinovec
9dc5f8c2e6 Use HasTenantOptions in Link 2022-09-28 10:16:31 +02:00
Samuel Štancl
b5e1913df9 [4.x] Storage::url() support (modified #689) (#909)
* This adds support for tenancy aware  Storage::url() method

* Trigger CI build

* Fixed Link command for Laravel v6, added StorageLink Events, more StorageLink tests, added RemoveStorageSymlinks Job, added Storage Jobs to TenancyServiceProvider stub, renamed misleading config example.

* Fix typo

* Fix code style (php-cs-fixer)

* Update config comments

* Format code in Link command, make writing more concise

* Change "symLinks" to "symlinks"

* Refactor Link command

* Fix test name typo

* Test fetching files using the public URL

* Extract Link command logic into actions

* Fix code style (php-cs-fixer)

* Check if closure is null in CreateStorageSymlinksAction

* Stop using command terminology in CreateStorageSymlinksAction

* Separate the Storage::url() test cases

* Update url_override comments

* Remove afterLink closures, add types, move actions, add usage explanation to the symlink trait

* Fix code style (php-cs-fixer)

* Update public storage URL test

* Fix issue with using str()

* Improve url_override comment, add todos

* add todo comment

* fix docblock style

* Add link command tests back

* Add types to $tenants in the action handle() methods

* Fix typo, update variable name formatting

* Add tests for the symlink actions

* Change possibleTenantSymlinks not to prefix the paths twice while tenancy is initialized

* Fix code style (php-cs-fixer)

* Stop testing storage directory existence in symlink test

* Don't specify full namespace for Tenant model annotation

* Don't specify full namespace in ActionTest

* Remove "change to DI" todo

* Remove possibleTenantSymlinks return annotation

* Remove symlink-related jobs, instantiate and use actions

* Revert "Remove symlink-related jobs, instantiate and use actions"

This reverts commit 547440c887.

* Add a comment line about the possible tenant symlinks

* Correct storagePath and publicPath variables

* Revert "Correct storagePath and publicPath variables"

This reverts commit e3aa8e2086.

* add a todo

Co-authored-by: Martin Vlcek <martin@dontfreakout.eu>
Co-authored-by: lukinovec <lukinovec@gmail.com>
Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2022-09-28 10:11:05 +02:00
Riley19280
5bedb08095 [4.x] Add batch tenancy queue bootstrapper (#874)
* exclude master from CI

* Add batch tenancy queue bootstrapper

* add test case

* skip tests for old versions

* variable docblocks

* use Laravel's connection getter and setter

* convert test to pest

* bottom space

* singleton regis in TestCase

* Update src/Bootstrappers/BatchTenancyBootstrapper.php

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

* convert batch class resolution to property level

* enabled BatchTenancyBootstrapper by default

* typehint DatabaseBatchRepository

* refactore name

* DI DB manager

* typehint

* Update config.php

* use initialize() twice without end()ing tenancy to assert that previousConnection logic works correctly

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-09-28 10:11:05 +02:00
Abrar Ahmad
f9f1f68947 [4.x] Finish incomplete and missing tests (#947)
* complete test sqlite manager customize path

* complete test seed command works

* complete uniqe exists test

* Update SingleDatabaseTenancyTest.php

* refactor the ternary into if condition

* custom path

* simplify if condition

* random dir name

* Update SingleDatabaseTenancyTest.php

* Update CommandsTest.php

* prefix random DB name with custom_

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-09-28 10:11:05 +02:00
lukinovec
0326855d7c [4.x] Optionally delete storage after tenant deletion (#938)
* Add test for deleting storage after tenant deletion

* Save `storage_path()` in a variable after initializing tenant in test

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>

* Add DeleteTenantStorage listener

* Update test name

* Remove storage deletion config key

* Remove tenant storage deletion events

* Move tenant storage deletion to the DeletingTenant event

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-09-28 10:11:05 +02:00
PHP CS Fixer
96a05c483c Fix code style (php-cs-fixer) 2022-09-28 07:49:05 +00:00
lukinovec
b56934674a Merge branch 'master' into stein-j-readied-tenant 2022-09-28 09:48:24 +02:00
Samuel Štancl
7bacc50b27
[4.x] Storage::url() support (modified #689) (#909)
* This adds support for tenancy aware  Storage::url() method

* Trigger CI build

* Fixed Link command for Laravel v6, added StorageLink Events, more StorageLink tests, added RemoveStorageSymlinks Job, added Storage Jobs to TenancyServiceProvider stub, renamed misleading config example.

* Fix typo

* Fix code style (php-cs-fixer)

* Update config comments

* Format code in Link command, make writing more concise

* Change "symLinks" to "symlinks"

* Refactor Link command

* Fix test name typo

* Test fetching files using the public URL

* Extract Link command logic into actions

* Fix code style (php-cs-fixer)

* Check if closure is null in CreateStorageSymlinksAction

* Stop using command terminology in CreateStorageSymlinksAction

* Separate the Storage::url() test cases

* Update url_override comments

* Remove afterLink closures, add types, move actions, add usage explanation to the symlink trait

* Fix code style (php-cs-fixer)

* Update public storage URL test

* Fix issue with using str()

* Improve url_override comment, add todos

* add todo comment

* fix docblock style

* Add link command tests back

* Add types to $tenants in the action handle() methods

* Fix typo, update variable name formatting

* Add tests for the symlink actions

* Change possibleTenantSymlinks not to prefix the paths twice while tenancy is initialized

* Fix code style (php-cs-fixer)

* Stop testing storage directory existence in symlink test

* Don't specify full namespace for Tenant model annotation

* Don't specify full namespace in ActionTest

* Remove "change to DI" todo

* Remove possibleTenantSymlinks return annotation

* Remove symlink-related jobs, instantiate and use actions

* Revert "Remove symlink-related jobs, instantiate and use actions"

This reverts commit 547440c887.

* Add a comment line about the possible tenant symlinks

* Correct storagePath and publicPath variables

* Revert "Correct storagePath and publicPath variables"

This reverts commit e3aa8e2086.

* add a todo

Co-authored-by: Martin Vlcek <martin@dontfreakout.eu>
Co-authored-by: lukinovec <lukinovec@gmail.com>
Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2022-09-28 05:09:45 +02:00
Riley19280
b78320b882
[4.x] Add batch tenancy queue bootstrapper (#874)
* exclude master from CI

* Add batch tenancy queue bootstrapper

* add test case

* skip tests for old versions

* variable docblocks

* use Laravel's connection getter and setter

* convert test to pest

* bottom space

* singleton regis in TestCase

* Update src/Bootstrappers/BatchTenancyBootstrapper.php

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

* convert batch class resolution to property level

* enabled BatchTenancyBootstrapper by default

* typehint DatabaseBatchRepository

* refactore name

* DI DB manager

* typehint

* Update config.php

* use initialize() twice without end()ing tenancy to assert that previousConnection logic works correctly

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-09-26 14:13:58 +02:00