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

618 commits

Author SHA1 Message Date
d98a170fbd
Invalidate resolver cache on delete (#1328) 2025-03-13 17:02:11 +01:00
MuHanz
3f9935784d
fix: add explicit nullable type declarations for UserImpersonation parameters (#1324) 2025-03-13 17:00:05 +01:00
Mohammad Javad Asna Ashari
e91ca11123
Refactor: Remove unreachable code after exception (#1271) 2024-12-29 21:28:29 +01:00
coreyhn
30cdc9461e
Fix ModelNotSyncMasterException message (#1257) 2024-10-02 23:44:08 +02:00
Samuel Štancl
ed52c48428
Always revert queue worker to the central context — fix #1229 (#1251)
* Fix #1229

* docker-compose -> docker compose in ci.yml

* docker->compose -> docker compose

* docker->compose -> docker compose

* clarify how dispatchNow() works
2024-09-17 18:12:33 +02:00
Samuel Štancl
ed029438cb
Make Cache::tags() support named parameters (fix #1256) 2024-09-17 18:09:49 +02:00
885179bf74 Fix #1223 - Vite regression introduced on Laravel 9 in v3.8.3 2024-05-22 19:42:20 +02:00
Bert Bredewold
120b8bc4ae
Use assetPathResolver closure if set (#1221)
The original Vite Facade uses the assetPathResolver closure (if set) to generate assets with a custom URL. This is needed when for example assets are cached on a CDN, or if you need assets from a central URL while in Tenant context.

This updates the Tenancy version of the Vite-Facade to bring back the assetPathResolver logic.
2024-05-13 17:15:26 +02:00
Lucas Romano
d6d991ced6
Fixing RedisCluster deprecation of phpredis 6. (#1208) 2024-04-12 20:05:55 +02:00
Samuel Štancl
72b1b48edd
[3.x] Laravel 11 support (#1180)
* Laravel 11 support

* wip

* trigger ci

* fix ci file

* try setting charset and collation on the default mysql connection

* Set default cache driver to redis in tests

* drop and recreate id column separately in autoincrement_ids_are_supported

* set default redis client to predis in tests

* revert fail-fast

* try reverting TenantModelTest change

* migrate phpunit configuration

* add parent::tearDown() call
2024-03-12 15:04:54 +01:00
8db27a358e Forget tenant parameter when a tenant is resolved from cache in PathTenantResolver (fix #1174) 2024-01-27 22:55:59 +01:00
chillbram
5fe8825f13
Make universal routes work for controller middleware (#1151)
* Make universal routes work for controller middleware

* add a fallback

---------

Co-authored-by: chillbram <7299762+chillbram@users.noreply.github.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2024-01-25 22:34:47 +01:00
Massimo Simonini
0b248f937d
Add step option to migrate-fresh command (#1164) 2023-11-21 02:25:32 +01:00
Samuel Štancl
caf2267a08 reimplement TenantAssetsController::validatePath() (fixes #1143) 2023-09-02 03:19:37 +02:00
Samuel Štancl
4af70d302f add extra $path validation to TenantAssetsController 2023-08-24 18:21:23 +02:00
tamiroh
395192442d
Add use (#1103) 2023-08-18 07:40:21 +02:00
Guilherme Saade
d4a99011e6
[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>
2023-02-16 17:21:06 +01:00
Joel Stein
7d59ff180f
Don't prevent accessing missing Tenant attributes. (#1045) 2023-02-01 06:24:53 +01:00
lukinovec
26b8569761
Cache crash fix (#1048) 2023-01-27 08:17:14 +01:00
Samuel Štancl
437a8ed05c remove typehint 2022-09-28 18:50:09 +02:00
Samuel Štancl
a2c53b58ba try to exclude Vite.php from coverage report 2022-09-28 18:43:39 +02:00
Samuel Štancl
d31a319cc7 remove import of nonexistent class in older Laravel versions 2022-09-28 17:11:35 +02:00
Samuel Štancl
6d599de067 convert ViteBundler to PHP 7 syntax 2022-09-28 17:06:05 +02:00
Wilsen Hernández
d093c1387d [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>
2022-09-28 16:24:49 +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
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
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
Stefan Ninic
435d8528a7
Fixed array to string conversion (#718)
* Fixed array to string conversion

Previous code would give this warning before actually showing exception message
`<warning>PHP Warning:  Array to string conversion in .../vendor/stancl/tenancy/src/CacheManager.php on line 24</warning>`

* Update variable & syntax

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2021-12-25 22:10:34 +01:00
sort72
08bfd6f9bb
Use tenant key on console commands instead of id (#768) 2021-12-25 15:24:34 +01:00
Frederic Habich
2726f07bca
fixed typo (#766)
fixed typo within description 'searhced' => 'searched'
2021-12-22 13:24:07 +01:00
Jasper Zonneveld
b58b068434
Add missing import for Domain model (#745) 2021-11-03 10:21:51 +01:00
Ralfs Garkaklis
20e1fa1959
Fixed typo (#684) 2021-07-08 13:32:17 +02:00
hackerESQ
740d670665
Adds ability to disable tenant asset routes (#636)
* Add option to enable/disable tenant asset route

* Only registers tenant route if enabled in config

* Uses proper config key

* Move routes config option

* Move config to service provider

* Moves config to service provider
2021-04-22 11:09:16 +02:00
stancl
6bcd327b75 Apply fixes from StyleCI 2021-04-22 09:04:14 +00:00