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

1283 commits

Author SHA1 Message Date
Samuel Štancl
a2c53b58ba try to exclude Vite.php from coverage report 2022-09-28 18:43:39 +02:00
Samuel Štancl
596c47329a remove import of Foundation\Vite in tests 2022-09-28 17:17:21 +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
Samuel Štancl
8ecdb49531 skip vite test in Laravel < 9 2022-09-28 16:49:41 +02:00
Samuel Štancl
ab2af5b388 rewrite ViteBundlerTest to phpunit syntax 2022-09-28 16:43:20 +02:00
Samuel Štancl
fd65cf1754 add todo 2022-09-28 16:35:10 +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
Anbuselvan Rocky
38fc706c97 fix: typo mistake (#954) 2022-09-28 16:24:29 +02:00
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
Abrar Ahmad
8e3b74f9d1
[4.x] Finish incomplete and missing tests (#947)
* complete test sqlite manager customize path

* complete test seed command works

* complete uniqe exists test

* Update SingleDatabaseTenancyTest.php

* refactor the ternary into if condition

* custom path

* simplify if condition

* random dir name

* Update SingleDatabaseTenancyTest.php

* Update CommandsTest.php

* prefix random DB name with custom_

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-09-24 04:08:44 +02:00
lukinovec
ab5fa7a247
[4.x] Optionally delete storage after tenant deletion (#938)
* Add test for deleting storage after tenant deletion

* Save `storage_path()` in a variable after initializing tenant in test

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

* Add DeleteTenantStorage listener

* Update test name

* Remove storage deletion config key

* Remove tenant storage deletion events

* Move tenant storage deletion to the DeletingTenant event

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-09-20 19:42:00 +02:00
Abrar Ahmad
abd17f83a1
add mssql health checks (#939) 2022-09-08 18:18:59 +02:00
Abrar Ahmad
f2c64088ed
[4.x] Set tenant as a default parameter for the URLs when using Path identification (#925)
* set tenant as default url parameter

* Update PathIdentificationTest.php

* assertion

* test rename

* fix tests

* fix string

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-09-02 19:04:00 +02:00
Abrar Ahmad
409190fae1
[4.x] Improve tenants:run command to execute Input\Output commands (#923)
* run command useable for questions asking commands

* move console classes to Console directory

* fix styling

* Update src/Commands/Run.php

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

* remove tenant migration line

* assert command executed in tenant context

* improve test

* cleanup code

* Update CommandsTest.php

* remove irrelevant assertions

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-09-02 18:46:13 +02:00
lukinovec
3bf2c39e1a
[4.x] Make impersonation tokens require stateful guards (#935)
* Throw an exception on attempt to create impersonation token with a non-stateful guard

* Test that impersonation tokens can only be created with a stateful guard

* Fix code style (php-cs-fixer)

* Escape backslashes in the exception's message

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

* Make the exception only about requiring a stateful guard

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-09-02 17:46:27 +02:00
lukinovec
f83504ac6f
[4.x] Add ScoutTenancyBootstrapper (#936)
* Add ScoutTenancyBootstrapper

* Fix code style (php-cs-fixer)

* extract getTenantPrefix method

* Fix code style (php-cs-fixer)

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-09-02 17:24:37 +02:00
PHP CS Fixer
020039bf89 Fix code style (php-cs-fixer) 2022-09-01 17:07:17 +00:00
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
Samuel Štancl
2b02198dda Move to archtechx/tenancy:latest 2022-08-30 16:23: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
Abrar Ahmad
fb8b9c1614
add phpstan (#926) 2022-08-29 20:55:33 +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
2d7e9dfd89 Add 'composer coverage' 2022-08-26 22:29:40 +02:00
Samuel Štancl
5f41647a6b revert Tenancy changes, fix failing tests 2022-08-26 21:49:09 +02:00
Samuel Štancl
02faf2407f Laravel 9 only 2022-08-26 21:39:05 +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
Abrar Ahmad
ddc7cf49c3
switch php version based on ARG (#924) 2022-08-26 16:42:57 +02:00
Erik Gaal
ca2eefa30a
[WIP] Use a lighter Docker image, use it in CI (#793)
* Use action services and setup-php in workflow

* Fix codecov

* 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>

* Improve Dockerfile and use it in CI

* Update Dockerfile

* mssql CI health check

* cache key

* Update ci.yml

* Update ci.yml

* Update composer.json

* register dumcommand when L8

* Update ci.yml

* Update composer.json

* Update composer.json

* Update composer.json

* wip

* removed extensions config and php version from matrix

* introduce php-cs-fixer issue for testing

* Fix code style (php-cs-fixer)

* install composer in Docker and remove setup-php step

* added pcov for coverage

* on master branch

* composer test command

* tests above services

* Update ci.yml

* Revert "register dumcommand when L8"

This reverts commit f165fc58ba.

* removed composer cache dependencies

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
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: Samuel Štancl <samuel@archte.ch>
Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2022-08-25 19:52:46 +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