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

90 commits

Author SHA1 Message Date
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
Samuel Štancl
40bf28c7d0 general refactor, move more classes under Database namespace 2022-08-27 03:17:16 +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
Samuel Štancl
96d9ad13d8
Add a note about 'tenant' connection being reserved (fixes #774) 2022-01-06 16:57:01 +01:00
stancl
54a33f93a8 Apply fixes from StyleCI 2021-04-22 09:09:22 +00: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
0d14911538 Apply fixes from StyleCI 2021-04-16 17:57:51 +00:00
Andrei Ioniță
bb5baced2a
Update config links to v3 docs (#486) 2020-09-01 12:38:25 +02:00
Samuel Štancl
616c5983a4 Use default DB connection for central 2020-06-05 21:03:55 +02:00
stancl
a0192a941e Apply fixes from StyleCI 2020-05-30 15:01:29 +00:00
Samuel Štancl
6788deca56 Drop keys for bootstrappers 2020-05-30 17:01:18 +02:00
Samuel Štancl
ed200ab733 Universal routes 2020-05-26 13:25:24 +02:00
stancl
1a85bca7ee Apply fixes from StyleCI 2020-05-24 18:40:24 +00:00
Samuel Štancl
2839f45196 Refactor models & config 2020-05-24 20:40:10 +02:00
stancl
6955512a6b Apply fixes from StyleCI 2020-05-22 09:01:31 +00:00
Samuel Štancl
2c1cc41b97 Telescope tags 2020-05-21 18:05:02 +02:00
Samuel Štancl
4f8d892481 Remove obsolete files, restructure 2020-05-21 15:54:35 +02:00
Samuel Štancl
fbe43fbb04 Restructure config 2020-05-21 15:05:05 +02:00
Samuel Štancl
15a7e52208 Get rid of tenant DB manager connection config 2020-05-21 14:47:29 +02:00
Samuel Štancl
7a7200fd25 Minor fixes for using the package in an app 2020-05-16 11:56:32 +02:00
Samuel Štancl
c8f9a82745 Cleanup after implementing impersonation 2020-05-15 07:39:19 +02:00
Samuel Štancl
1a8d150f2c Change bootstrappers namespace 2020-05-13 18:19:59 +02:00
Samuel Štancl
c32f229dd5 Refactor more old code and get tests to pass 2020-05-13 04:51:37 +02:00
Samuel Štancl
89936187ce Rewrite old tests 2020-05-12 23:22:40 +02:00
Samuel Štancl
3c4d2189dc DatabasePreparationTest 2020-05-12 03:14:08 +02:00
Samuel Štancl
6f4b9f486c Bootstrapper tests 2020-05-11 03:37:47 +02:00
Samuel Štancl
8ea4940f34 Identification middleware & tests 2020-05-10 05:47:27 +02:00
Samuel Štancl
e1a4054743 Domain model & resolver test 2020-05-08 18:16:18 +02:00
Samuel Štancl
bd9aad229b vague first draft of v3. TenantModelTest is passing 2020-05-08 04:37:43 +02:00
Samuel Štancl
c2c90ff755
[3.x] Use static properties instead of config for features (#391)
* Use static properites instead of config for features

* update tests
2020-05-03 18:12:40 +02:00
Samuel Štancl
3bb2759fe2
[3.x] DB users (#382)
* Initial draft

* Apply fixes from StyleCI

* Use CI on master branch too

* Pass correct argument to queued DB creators/deleters

* Apply fixes from StyleCI

* Remove new interface from MySQLDBManager

* Make phpunit run

* Apply fixes from StyleCI

* Fix static property

* Default databaseName

* Use database transactions for creating users & granting permissions

* Apply fixes from StyleCI

* Get old tests to pass

* Apply fixes from StyleCI

* Add tests for PermissionControlledMySQLDatabaseManager

* Apply fixes from StyleCI

* Write test for extra config, fix bug with extra config

* Apply fixes from StyleCI
2020-05-03 18:12:27 +02:00
Samuel Štancl
60665517a0
[v3] Rename tenant redirect macro (#389)
* [v3] Rename tenant redirect macro

* update tests
2020-05-03 17:59:59 +02:00
Samuel Štancl
4ff82a950d
Switch up DB deletion configs 2020-04-29 22:32:44 +02:00
Samuel Štancl
7c88e883cf
Update config.php 2020-04-24 20:21:42 +02:00
Samuel Štancl
e258711cc9
Make config more understandable (#348)
* Make config more understandable

* Apply fixes from StyleCI

* Add two comments to migration_parameters
2020-04-23 19:06:36 +02:00
Samuel Štancl
526f0826a4
Use seeder params in tenants:seed instead of just the automatic seeder (#317)
* Use seeder params in tenants:seed instead of just the automatic seeder

* Left trim - from option names

* Use no seeder params for tests
2020-03-17 15:59:45 +01:00
Samuel Štancl
776af4643c Make null falsey for cache config because config is not merged recursively 2020-03-17 15:30:24 +01:00
Samuel Štancl
c7c6a7fec8
[2.3.0] Cached tenant lookup (#316)
* Begin work on cached lookup

* Apply fixes from StyleCI

* wip

* wip cache invalidation

* Apply fixes from StyleCI

* Finish cache invalidation

* Apply fixes from StyleCI

* Remove config from TestCase

* Enable cache in the single test file

* Separate data & domains logic

* Apply fixes from StyleCI

* wip

* Apply fixes from StyleCI
2020-03-14 19:52:35 +01:00
Noor Adiana
d0023c482a
Add support for postgres schema (#237)
* Add support for postgres schema

* wip

* Apply fixes from StyleCI

* revert to db as default for pgsql

* Move separate_by to database

* Fixing testing

* Fixing style

* Reverted change

* Store string instead of Connection instance

* Remove use statement

* Add use statement for DB facade

* mysql -> pgsql

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2020-03-10 20:15:07 +01:00
Samuel Štancl
292b7acd16
Make asset tenancy optional (#300) 2020-02-26 09:14:40 +01:00
Samuel Štancl
98ce0ee294
Make DB creation optional (#299) 2020-02-26 08:49:08 +01:00
Jess Johannessen
5145b1f13e Added support for migration parameters (#243) 2019-12-10 16:56:51 +01:00
Samuel Štancl
1ef061ffc7 Array with global MW 2019-11-04 18:36:22 +01:00
Samuel Štancl
31c9930c93
[2.2.0] Timestamps (#213)
* Timestamps

* Apply fixes from StyleCI

* Add void typehint

* wip

* Fix tests

* Apply fixes from StyleCI
2019-11-04 17:56:08 +01:00
Samuel Štancl
3ec4314e91
[2.2.0] Optional storage path suffixing (#197)
* Optional storage path suffixing

* Default value true
2019-10-27 21:49:28 +01:00
Samuel Štancl
869ac32983
[2.2.0] [WIP] Add functionality (#206)
* TenantDatabaseDoesNotExistException

* Apply fixes from StyleCI

* User post-creation callbacks

* Rename method

* postCreationActions

* pass $tenant as parameter

* pass $tenant to async actions

* WIP findBy()

* findBy\* ForwardsCalls

* Apply fixes from StyleCI

* findBy DB storage driver

* Redis  SD TODO message

* Apply fixes from StyleCI

* Fix chained jobs

* WIP event system

* import str

* instanceof closure check

* findBy instead of find

* Tenant -> Tenants

* dots

* Use DB hooks instead of a SC key

* Don't allow  callables for queue chain

* CanDeleteKeys interface

* Apply fixes from StyleCI

* CanFindByAnyKey interface

* Apply fixes from StyleCI

* Ditch models for custom repositories

* Resolve circular dependency

* Apply fixes from StyleCI

* Fix tests

* Apply fixes from StyleCI

* FutureTest

* Prefix tenant events with 'tenant.'

* Event listener arguments test
2019-10-27 21:10:41 +01:00
Samuel Štancl
b4caaaed51 Add comments to config 2019-10-26 22:01:01 +02:00
Samuel Štancl
bb4dc196b0
[2.2.0] Make tenancy initialization in global MW stack optional (#203)
* Make tenancy initialization in global MW stack optional

* update config key
2019-10-26 21:17:28 +02:00
Chris Brown
d5b01219fd [2.x] Allow automatic seeding after automatic migrations (#160) 2019-10-17 19:25:30 +02:00