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

1044 commits

Author SHA1 Message Date
Abrar Ahmad
836716c74c method rename 2022-10-26 12:55:31 +05:00
Abrar Ahmad
0a4dc59912 fix test 2022-10-26 12:44:47 +05:00
Abrar Ahmad
e5cf5c0f82 replace hostManager with manager 2022-10-26 12:41:40 +05:00
PHP CS Fixer
780a8f8519 Fix code style (php-cs-fixer) 2022-10-25 10:54:55 +00:00
Samuel Štancl
b3902bcf29 Merge branch 'master' into 515-complete 2022-10-25 12:54:21 +02:00
Samuel Štancl
fe0a322b87 add public connection() method to the Tenant DB manager interface 2022-10-25 12:53:31 +02:00
89c137709a
add new assertions [ci skip] 2022-10-25 12:28:32 +02:00
d4631a1f3a
add DB::purge() calls 2022-10-25 12:14:57 +02:00
Abrar Ahmad
5b39cb4730 Update TenantDatabaseManagerTest.php 2022-10-25 14:46:04 +05:00
Abrar Ahmad
6853e752c4 Update TenantDatabaseManagerTest.php 2022-10-25 11:05:04 +05:00
Abrar Ahmad
44898bfda4 change inline variable name 2022-10-25 10:45:28 +05:00
4f21ab0449
typo 2022-10-24 15:00:47 +02:00
Abrar Ahmad
c025efa8c7 update test name and improve assertions 2022-10-20 17:11:11 +05:00
Abrar Ahmad
a7f559567d Update TenantDatabaseManagerTest.php 2022-10-20 12:45:42 +05:00
Abrar Ahmad
b95b6cadca tenancy_db_connection tenant config test 2022-10-20 12:37:08 +05:00
Abrar Ahmad
c252e0c405 remove unness mysql config and add a comment 2022-10-19 10:52:52 +05:00
Samuel Štancl
5d688e6e5d remove duplicate 'routes/tenant.php' from message 2022-10-18 21:52:02 +02:00
Jori Stein
e4f5b92485
[4.x] Update commands CLI outputs (#968)
* Using laravel components

* Ensure commands returns success

* update tests

* clean

* bump EndBug version

* Update ci.yml

* Update ci.yml

* Update ci.yml

* revert CI changes

* Update ci.yml

* Update ci.yml

* Update ci.yml

* revert CI changes to it's original state

* fix typos, improve code

* improve Install & TenantList commands

* php-cs-fixer

* type GitHub properly

Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-10-18 19:11:57 +02:00
Abrar Ahmad
f95f7382cf update comment 2022-10-18 18:01:06 +05:00
Abrar Ahmad
7186afd271
Update src/Database/DatabaseConfig.php
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-10-18 17:47:51 +05:00
d57a1042b3
add default 2022-10-18 14:15:46 +02:00
Abrar Ahmad
05f1b2d6f5
Add cookie option on Initialize Tenancy by Request identification (#980)
* Add cookie option on Initialize Tenancy by Request identification

* add cookie property
2022-10-18 13:52:16 +02:00
PHP CS Fixer
693e00b9be Fix code style (php-cs-fixer) 2022-10-17 17:48:49 +00:00
Jori Stein
3f60c4a652
Add maintenance mode events (#979) 2022-10-17 19:48:24 +02:00
lukinovec
080b271bb3
[4.x] Drop tenant databases on migrate:fresh (#971)
* Test that `migrate:fresh` deletes tenant databases

* Delete tenants on `migrate:fresh`

* Fix code style (php-cs-fixer)

* Add config key for dropping tenant databases on `migrate:fresh`

* Add MigrateFreshOverride

* Try to override `migrate:fresh` in TenancyServiceProvider

* Update `migrate:fresh` test

* Fix code style (php-cs-fixer)

* Drop tenant databases by default

* Change `migrate:fresh` test to test if the tenant DBs are dropped by default

* Override `migrate:fresh` by extending `FreshCommand` in TenancyServiceProvider

* Update MigrateFreshOverride

* Fix code style (php-cs-fixer)

* Fix commands test

* Simplify handle method

* Fix code style (php-cs-fixer)

* Don't drop tenant DBs on migrate:fresh by default

* Change command overriding

* Update migrate:fresh test

* always register MigrateFreshOverride

* misc

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-10-17 15:19:30 +02:00
lukinovec
42dab2985a
Add current() and currentOrFail() tenant methods (#970)
* Add and test `Tenant::current()`

* Add and test `Tenant::currentOrFail()`

* Fix code style (php-cs-fixer)

* Update currentOrFail declaration

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

* Change self return type to static

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-10-11 10:33:32 +02:00
Abrar Ahmad
9418402c17 Revert "Update TenantDatabaseManagerTest.php"
This reverts commit b8e0a1c982.
2022-10-10 17:17:58 +05:00
Abrar Ahmad
69e4a1ef2a Merge branch 'master' into 515-complete 2022-10-10 16:34:02 +05:00
Abrar Ahmad
8bde0a7ecb Update DatabaseConfig.php 2022-10-10 16:24:31 +05:00
Abrar Ahmad
b8e0a1c982 Update TenantDatabaseManagerTest.php 2022-10-10 14:43:43 +05:00
Samuel Štancl
76a3e269c8 final class -> class 2022-10-09 19:53:14 +02:00
Abrar Ahmad
f8ec22b5ca removing test because other two tests are using the same logic, so this test kinda already covered 2022-10-07 12:39:55 +05:00
Abrar Ahmad
47e2aca2db remove test because it's duplicate 2022-10-07 12:30:50 +05:00
Abrar Ahmad
7c4afc37d0 remove "ensuring connection exists" check 2022-10-07 12:25:03 +05: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
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
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
Abrar Ahmad
7f6166d49a improve comments 2022-09-29 17:04:39 +05:00