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

778 commits

Author SHA1 Message Date
Samuel Štancl
f941df3a82 minor improvements for phpstan 2022-09-01 19:06:54 +02:00
emargareten
62d19c5f5d
Reverse bootstrappers when reverting to central (#932)
Some of my bootstrappers are depending on previous bootstrappers but when reverting it needs to run in reverse order.
Submitting to v4 since this might be a breaking change (currently I am overriding this file).
2022-08-30 16:24:50 +02:00
Abrar Ahmad
3542b3f028
update spatie/ignition to support L9 (#930) 2022-08-30 15:21:19 +02:00
PHP CS Fixer
3605252d85 Fix code style (php-cs-fixer) 2022-08-30 03:46:17 +00:00
Samuel Štancl
8af354c20e get phpstan errors down from 252 to 189 2022-08-30 05:44:23 +02:00
PHP CS Fixer
eade69c3f4 Fix code style (php-cs-fixer) 2022-08-27 20:29:46 +00:00
Samuel Štancl
d2e1ce0a1e refactor TenantDatabaseManagers 2022-08-27 22:29:08 +02:00
PHP CS Fixer
824292e6df Fix code style (php-cs-fixer) 2022-08-27 01:17:45 +00:00
Samuel Štancl
40bf28c7d0 general refactor, move more classes under Database namespace 2022-08-27 03:17:16 +02:00
Samuel Štancl
5f41647a6b revert Tenancy changes, fix failing tests 2022-08-26 21:49:09 +02:00
PHP CS Fixer
06cc7bf686 Fix code style (php-cs-fixer) 2022-08-26 19:35:44 +00:00
Samuel Štancl
55d0a9ab87 misc improvements - stronger types, exception refactor 2022-08-26 21:35:17 +02:00
Samuel Štancl
931c76d697
Pull 3.x changes into master (#922)
* exclude master from CI

* Add space after 'up' in 'docker-compose up-d' (#900)

* Fix ArgumentCountError on the TenantAssetsController (#894)

* Fix ArgumentCount exception on the TenantAssetsController when no `$path` is provided

* CS

* CS

* Handle null case explicitly

* code style

Co-authored-by: Bram Wubs <bram@sibi.nl>
Co-authored-by: Samuel Štancl <samuel@archte.ch>

* Add support for nested tenant config override (#920)

* feat: add support for nested tenant config override

* test: ensure nested tenant values are mapped

* Update TenantConfigTest.php

Co-authored-by: lukinovec <lukinovec@gmail.com>
Co-authored-by: Bram Wubs <megawubs@users.noreply.github.com>
Co-authored-by: Bram Wubs <bram@sibi.nl>
Co-authored-by: George Bishop <email.georgebishop@gmail.com>
Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
2022-08-22 17:59:43 +02:00
Samuel Štancl
fce95aa862 Merge branch 'master' of github.com:archtechx/tenancy 2022-08-21 18:12:27 +02:00
George Bishop
1ea3cefa1d
Add support for nested tenant config override (#920)
* feat: add support for nested tenant config override

* test: ensure nested tenant values are mapped
2022-08-21 16:43:01 +02:00
PHP CS Fixer
db4a795c3e Fix code style (php-cs-fixer) 2022-08-04 18:30:06 +00:00
Abrar Ahmad
a45aa8e274
Improve tenants:run command (#912)
* improve `tenants:run` command

* Update Run.php
2022-08-04 20:29:39 +02:00
Samuel Štancl
e4a47f3e6e Set default $tenant value 2022-08-02 15:21:02 +02:00
Samuel Štancl
3ea38bba4d Merge branch 'master' of github.com:tenancy-for-laravel/v4 2022-08-02 15:01:09 +02:00
Samuel Štancl
da0072bfe8 Fix $tenant type 2022-08-02 15:01:03 +02:00
PHP CS Fixer
9c584b8394 Fix code style (php-cs-fixer) 2022-08-02 02:21:33 +00:00
Samuel Štancl
e9b6de78b2 minor code updates 2022-08-02 04:21:03 +02:00
PHP CS Fixer
3d8d670447 Fix code style (php-cs-fixer) 2022-07-28 13:30:51 +00:00
Samuel Štancl
d0baabbc9d Merge branch 'master' of github.com:archtechx/tenancy 2022-07-28 15:30:19 +02:00
Samuel Štancl
be13160133 wip Debuggable trait 2022-07-28 15:14:29 +02:00
beezerk23
233a1222bf
feat(UniversalRoutes): Stop overwriting the (maybe) customized onFail… (#679)
* feat(UniversalRoutes): Stop overwriting the (maybe) customized onFail method and just call it in case of an exception

* throw correct exception when `$originalOnFail()` is null

* Update DomainTest.php

* convert test to pest and renamed

* Update tests/DomainTest.php

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

Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-07-25 18:37:52 +02:00
Bram Wubs
747c192979
Fix ArgumentCountError on the TenantAssetsController (#894)
* Fix ArgumentCount exception on the TenantAssetsController when no `$path` is provided

* CS

* CS

* Handle null case explicitly

* code style

Co-authored-by: Bram Wubs <bram@sibi.nl>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-07-20 21:35:33 +02:00
PHP CS Fixer
c0f97fa04e Fix code style (php-cs-fixer) 2022-07-20 13:29:11 +00:00
Abrar Ahmad
97ab483173
Completing PR #881 (#902)
* install PHP CS Fixer

* Fix styling

* remove StyleCI config

* use config from archtechx/template

* Fix styling

* added `php-cs-fixer`

* Update .php-cs-fixer.php

* added GitHub token

* Update ci.yml

* Update ci.yml

* Update ci.yml

* php-cs-fixer workflow same as template

Co-authored-by: Erik Gaal <me@erikgaal.nl>
Co-authored-by: erikgaal <erikgaal@users.noreply.github.com>
2022-07-20 15:28:45 +02:00
Abrar Ahmad
627233d07a
[4.x] Don't use onDeleteCascade in the migrations (#883)
* removed `cascade` on delete for domains

* removed only `onDelete` cascade

* keep impersonation migrations unchanged

* domains set null on delete

* Update 2019_09_15_000020_create_domains_table.php

* Added DeleteDomain Job while deleting tenant.

* Update assets/TenancyServiceProvider.stub.php

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

* renamed class

* Update DeleteDomains.php

* onDelete restrict

* revert nullable

* removed `shouldQueue` interface

* Update TenancyServiceProvider.stub.php

* fetch and delete domains individually

* Update DeleteDomains.php

* tests for `DeleteDomains` job

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-07-20 13:02:33 +02:00
Nick Kitchen
cc6d4fe0dd
[4.x] Added support for Microsoft Sql Server (#715)
* added support for microsoft sql server database

* added support for microsoft sql server database

* trigger ci

* revert change

* trigger ci

* Try installing pdo_sqlsrv

* different approach for installing sqlsrv via pecl

* add dependencies

* add gnupg2

* Update Dockerfile

* try skipping msodbcsql17

* Update Dockerfile

* add dependency back

* update before installing

* try to add mssql

* mssql host

* TENANCY_TEST_MSSQL_HOST env var

* add env vars for mssql

* add sqlsrv vars to TestCase

* rename vars to SQLSRV [skip ci]

* MSSQL -> SQLSRV

Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-06-23 13:04:53 +02:00
Victor R
7d98ebb5d1
[4.x] Add tenant schema dump command (#807)
* Add tenant dump command

* Register tenant schema dump command

* Added tests for tenant schema dump command

* remove docblocks, fix tenant() logic

* trigger ci

* Install mysql-client

* mysql-client -> mariadb-client

* add tenant-schema-test.dump to .gitignore

Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-06-01 16:12:59 +02:00
Samuel Štancl
eca7b336bc merge 3.x 2022-06-01 14:58:44 +02:00
Vincent GS
51228defc6
[3.x][Filesystem] Provide an additional argument for tenant name path (#817)
* Let the user pass the tenant suffix by %tenant%

In this PR we let the user pass an additional parameter using `%tenant%` so the user can additionally pass the folder corresponding to each tenant.
This is my proposal, because if I try to use %storage_path% within Linux, I get the full path to the project when I use Google Cloud Storage

* Missing missing updates

Moving from $subject to $root when %storage_path% has been replaced
2022-05-26 11:51:27 +02:00
Samuel Štancl
4d95e88e27 Revert "Resolve #854"
This reverts commit a1c3442148.
2022-05-15 13:45:54 +02:00
Samuel Štancl
a1c3442148
Resolve #854 2022-05-15 13:32:09 +02:00
Nathan Dunn
40bf576e00
[3.x] Update PostgreSQLSchemaManager to set correct config key value (#840)
* Update PostgreSQLSchemaManager to set correct config key value

* Update to use version_compare

* Update TenantDatabaseManagerTest

* Improve TenantDatabaseManagerTest

* Update TenantDatabaseManager
2022-04-08 03:13:29 +02:00
Roy de Vos Burchart
f065ea60b0
Update QueueTenancyBootstrapper.php (#836) 2022-04-01 22:53:09 +02:00
Samuel Štancl
349125c02e
Merge hotfix branch (#834)
* try specifying the signature in __construct

* constructor doesn't work since Reflection is used, try specifying getDefaultName() instead

* Fixed: make migration commands compatible

* Fix failing tests

* Fix username generation

* Re-create tmp dir as well if needed

* wip
2022-03-30 18:00:55 +02:00
Samuel Štancl
600bb823de avoid double // in prefix 2022-03-23 20:49:25 +01:00
Samuel Štancl
5026f54a6d fix path prefixing 2022-03-23 20:48:55 +01:00
Samuel Štancl
49ebb75f00
Fixes #827 2022-03-17 12:46:49 +01:00
Erik Gaal
79e3d53b06
[3.x] Compatibility with Laravel 9 (#802)
* Test on Laravel 9

* Don't extend final Kernel class

* Make FilesystemTenancyBootstrapper compatible with Flysystem v3

Co-authored-by: George <jiri.zizka@funfirst.cz>

* Update tenant maintenance mode te be in line with Laravel

* Exclude PHP 7.4 <> L9 combination from testing

* add root_override-related assertions

* getPrefix -> getPathPrefix

* handle / inconsistency in s3 prefix

* Refactor Storage facade changes

Co-authored-by: George <jiri.zizka@funfirst.cz>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-03-08 01:50:25 +01:00
masiorama
b4a4eab949
Add drop of db views on migrate fresh command (#812)
* Optionally handle drop of table views on MigrateFresh

@stancl I managed to make the modification discussed here #811 
Afaik (and I can understand) this is the easiest way to handle it, but I'm open to discuss.

* Remove redundant store variable

* code style

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-02-22 16:26:07 +01:00
Samuel Štancl
368d3cc99f add forceRefresh option to QueueTenancyBootstrapper 2022-02-19 16:21:27 +01:00
Samuel Štancl
27f916c323 end tenancy in queue if the next job is not tenant aware 2022-02-19 16:12:38 +01:00
Jori Stein
f08e33afd8
Remove redondant initialization (#775) 2022-01-06 21:35:56 +01:00
Samuel Štancl
e442bdb644 Only use JobRetryRequested in Laravel 8 2021-12-31 18:29:05 +01:00
Samuel Štancl
a83568ded2 Only use JobRetryRequested in Laravel 8 2021-12-31 18:28:37 +01:00
Samuel Štancl
73a4a3018c Improve queue tenancy 2021-12-31 18:10:03 +01:00