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

1178 commits

Author SHA1 Message Date
lukinovec
39e62c7dcf Make original prefixes customizable 2023-04-12 08:23:31 +02:00
lukinovec
940fb1744b Move logic from separate method to __call 2023-04-12 07:21:33 +02:00
lukinovec
2d0ee2c7cd Improve CacheManager 2023-04-12 07:17:29 +02:00
lukinovec
70051e70b3 Rename bootstrapper 2023-04-11 15:01:08 +02:00
PHP CS Fixer
52dabed878 Fix code style (php-cs-fixer) 2023-04-11 12:29:44 +00:00
lukinovec
7ebfc375d6 Disable cache tagging by default, add CacheTagBootstrapper 2023-04-11 14:28:28 +02:00
lukinovec
5849afa4c8 Use $this->config instead of config() 2023-04-07 12:03:55 +02:00
lukinovec
66669934f9 Reset static properties in afterEach 2023-03-31 14:11:45 +02:00
lukinovec
840cd831d6 Delete CacheTenancyBootstrapper 2023-03-31 14:10:56 +02:00
lukinovec
7bbd5350c7 Update tests 2023-03-31 09:20:10 +02:00
lukinovec
1f1c7cc2bc Fix original prefix logic 2023-03-31 09:19:46 +02:00
lukinovec
8ea3cc9739 Use default prefix generator inline, delete the 'default' key logic 2023-03-31 07:51:20 +02:00
lukinovec
c45f900b78 Delete tmpfs from docker-compose.yml (there were no benefits) 2023-03-30 14:37:32 +02:00
e9aa5be546
Update ci.yml 2023-03-20 21:50:17 +01:00
lukinovec
a1dc8e93b8 Merge branch 'master' of github.com:archtechx/tenancy into cache-prefix 2023-03-20 12:19:15 +01:00
Samuel Štancl
dfd39722a7
bump stancl/jobpipeline to v2.0.0-rc1 2023-03-16 22:20:47 +01:00
PHP CS Fixer
9388459d7d Fix code style (php-cs-fixer) 2023-03-14 16:30:41 +00:00
lukinovec
7b91e3fdec Test cache prefixing customization 2023-03-14 17:24:57 +01:00
lukinovec
8348389fb3 Add customizing cache store prefixes 2023-03-14 17:22:56 +01:00
lukinovec
660b772fe3 Use tmpfs in docker-compose 2023-03-14 17:19:45 +01:00
lukinovec
5a20a0e2a7 Update Laravel 2023-03-14 17:19:31 +01:00
lukinovec
719b1be245
Fix URL root override example (#1079) 2023-03-01 10:40:56 +01:00
lukinovec
b715571927 Prefix all cache stores specified in $tenantCacheStores 2023-02-24 09:17:24 +01:00
lukinovec
4638392788 Use 10.x-dev 2023-02-23 14:33:29 +01:00
lukinovec
a7e4956ee5 Specify 10.1.1 as the minimal Laravel version in ci.yml 2023-02-23 14:22:51 +01:00
lukinovec
cf799d3529 Complete L9 support removal 2023-02-23 14:21:36 +01:00
lukinovec
a152d31ac4 Use new Laravel release, remove L9 support 2023-02-23 14:17:30 +01:00
lukinovec
9e8af40715 Test that non-default stores get prefixed too 2023-02-21 18:48:57 +01:00
Samuel Štancl
76dae7b025 Revert "use the laravel version from the ci matrix for the phpstan job as well"
This reverts commit 5f3079d2ff.
2023-02-21 18:42:31 +01:00
Samuel Štancl
5f3079d2ff use the laravel version from the ci matrix for the phpstan job as well 2023-02-21 18:38:20 +01:00
4acf7e26b5
10.x-dev (fix conflict resolution) 2023-02-21 18:35:46 +01:00
Samuel Štancl
20f9b7fc42 merge 2023-02-21 18:31:50 +01:00
Samuel Štancl
d655d3acf7 remove L9 support 2023-02-21 18:31:16 +01:00
Samuel Štancl
b883d52a6a Merge branch 'master' into cache-prefix 2023-02-21 18:30:18 +01:00
Samuel Štancl
8b7862d8ad
add --xdebug option to phpstan 2023-02-21 18:28:57 +01:00
c254f621ce
use 10.x-dev instead of master 2023-02-21 18:22:29 +01:00
587396b5ca
remove laravel fork from repositories 2023-02-21 18:21:02 +01:00
Samuel Štancl
a48e447389 use dev-master before our changes are released in L10 2023-02-21 17:49:15 +01:00
Samuel Štancl
f0407e781b Merge branch 'master' into cache-prefix 2023-02-21 17:48:49 +01:00
Samuel Štancl
e531f96c4b
specify full laravel versions to support using dev-master in PRs 2023-02-21 17:47:25 +01:00
lukinovec
249fc545d2
Merge branch 'master' into cache-prefix 2023-02-21 10:22:17 +01:00
Samuel Štancl
858249759f Merge branch 'master' of github.com:archtechx/tenancy 2023-02-21 00:40:40 +01:00
lukinovec
e61a26d604
Add L10 support to 4.x (merge 3.x to master) (#1071)
* 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

* fix: typo mistake (#954)

* [3.x] Add Vite helper for tenancy (#956)

* Add Vite helper for tenancy

* Move Vite bundler to an Optional Feature

* Rename to foundation vite

* Add ViteBundlerTest

* Add missing end of file

* Update tests

* remove unnecessary end() call

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

* rewrite ViteBundlerTest to phpunit syntax

* skip vite test in Laravel < 9

* convert ViteBundler to PHP 7 syntax

* remove import of nonexistent class in older Laravel versions

* remove import of Foundation\Vite in tests

* try to exclude Vite.php from coverage report

* remove typehint

* update channel name

* Cache crash fix (#1048)

* Don't prevent accessing missing Tenant attributes. (#1045)

* [3.x] L10 compatibility (#1065)

* Bump dependencies for Laravel 10

* Update GitHub Actions for Laravel 10

* ci: do not test L10 using PHP 7.3

* drop < L9 support

* use `dispatch_sync` instead of `dispatch_now`

* migrate phpunit configuration

* Update ci.yml

* drop laravel < 9 support

* misc L10 fixes, new docker image

* specify odbc version

* wip

* properly list php versions as strings

* minor changes

* Add `getValue($queryGrammar)` to raw query

* Clean up `isVersion8` code

* rewrite hasFailed assertion

* phpunit schema update

* Upgrade `doctrine/dbal`

---------

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

* Update ci.yml

* Fix code style (php-cs-fixer)

* Update dependencies

* Change invade version

* Delete ViteBundlerTest

* Fix PHPStan error

* Delete PHPStan error ignore

* Fix CONTRIBUTING.md

* Delete ViteBundler remains

* Bring back ViteBundler

* Convert ViteBundlerTest to Pest

* Update ci.yml

---------

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
Co-authored-by: Bram Wubs <megawubs@users.noreply.github.com>
Co-authored-by: Bram Wubs <bram@sibi.nl>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: George Bishop <email.georgebishop@gmail.com>
Co-authored-by: Anbuselvan Rocky <15264938+anburocky3@users.noreply.github.com>
Co-authored-by: Wilsen Hernández <13445515+wilsenhc@users.noreply.github.com>
Co-authored-by: Joel Stein <joel@mediatrix.digital>
Co-authored-by: Guilherme Saade <saade@outlook.com.br>
Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2023-02-20 23:47:10 +01:00
lukinovec
d7a4982cd3
[4.x] Make broadcasting work with Tenancy (#1027)
* Add BroadcastTenancyBootstrapper and TenancyBroadcastManager

* Fix code style (php-cs-fixer)

* Bind original BroadcastManager again on `revert()`

* Fix code style (php-cs-fixer)

* Move manager to correct directory

* Fix property type

* Make BroadcastTenancyBootstrapper a singleton in tests

* Fix code style (php-cs-fixer)

* Bind the original broadcaster instance on `revert()`

* Instead of just forgetting the old broadcaster instance, bind the new one

* Add BroadcastTenancyBootstrapper tests

* Separate the test

* Fix code style (php-cs-fixer)

* Add bootstrapper test

* Add broadcaster channels test

* Clean up BootstrapperTest

* Fix BroadcastingTest

* Add comments to TenancyBroadcastManager

* Add BroadcastTenancyBootstrapper comments

* Simplify BroadcastManager extension, remove setDriver method

* Add comment

* Fix PHPStan errors

* Fix PHPStan errors

* Remove duplicate import

* Fix test

* Delete `::class` from test name

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

* Create databases for newly created tenants in BroadcastingTest

* move spatie/invade to require

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2023-02-18 15:52:55 +01:00
lukinovec
fbdb13f392
[4.x] Set app.url config in UrlTenancyBootstrapper (#1068)
* Set `app.url` config in UrlTenancyBootstrapper

* Add assertions

* Set base app URL in config

* Make UrlTenancyBootstrapper a singleton
2023-02-18 13:01:17 +01:00
lukinovec
617e9a7a73
[4.x] Allow user to customize tenant's URL root in CLI (#1044)
* Add UrlTenancyBootstrapper

* Fix code style (php-cs-fixer)

* Move URL overriding to a separate method, call it in `boot()`

* Test URL root overriding

* Change parameter formatting

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

* Fix code style (php-cs-fixer)

* Improve URL bootstrapper test

* Move `$scheme` and `$hostname` to the closure

* Update code example comment

* Hardcode values instead of referencing variables

* Delete extra line

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2023-02-17 10:56:43 +01:00
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