From 9cf5b8d870e4a9f5f47fbcb0f97ff31c58915732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Wed, 8 Apr 2020 14:25:08 +0200 Subject: [PATCH 01/14] Create FUNDING.yml --- .github/FUNDING.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..67776182 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: stancl +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: samuelstancl +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: ['https://www.paypal.me/samuelstancl', 'https://gumroad.com/l/tenancy'] From e44b3a1776e592a755f08f595c42aa9e762cf3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Wed, 8 Apr 2020 14:25:50 +0200 Subject: [PATCH 02/14] Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 67776182..2f8dfbed 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,6 +1,6 @@ # These are supported funding model platforms -github: stancl +# github: stancl patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: samuelstancl From a99e8ac341065893c66eeaef57a6f57817f99890 Mon Sep 17 00:00:00 2001 From: Jona Goldman Date: Fri, 10 Apr 2020 18:57:27 -0500 Subject: [PATCH 03/14] Fix getTenantIdByDomain() return type (#350) --- src/StorageDrivers/Database/CachedTenantResolver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StorageDrivers/Database/CachedTenantResolver.php b/src/StorageDrivers/Database/CachedTenantResolver.php index 9a4a345c..db4d5a46 100644 --- a/src/StorageDrivers/Database/CachedTenantResolver.php +++ b/src/StorageDrivers/Database/CachedTenantResolver.php @@ -28,7 +28,7 @@ class CachedTenantResolver return $this->config->get('tenancy.storage_drivers.db.cache_ttl'); } - public function getTenantIdByDomain(string $domain, Closure $query): string + public function getTenantIdByDomain(string $domain, Closure $query): ?string { return $this->cache->remember('_tenancy_domain_to_id:' . $domain, $this->ttl(), $query); } From 99b34f602c986b89ca5728dfef9638ef7a0144d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Mon, 13 Apr 2020 12:41:02 +0200 Subject: [PATCH 04/14] Update SUPPORT.md --- SUPPORT.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SUPPORT.md b/SUPPORT.md index 8f782e51..e35775e1 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -2,6 +2,8 @@ If you need help with implementing the package, you can: - Open an [issue here on GitHub](https://github.com/stancl/tenancy/issues/new?assignees=stancl&labels=support&template=support-question.md&title=) -- Message me (`@stancl`) on the [Unofficial Laravel Discord](https://discord.gg/zGVGFAd), in the `#stancl_tenancy` channel +- Join our new [Discord server](https://discord.gg/7cpgPxv) and ask in `#help` + +The methods above are preferred, but you may also - Contact me on Telegram: [@samuelstancl](https://t.me/samuelstancl) - Send me an email: [samuel.stancl@gmail.com](mailto:samuel.stancl@gmail.com) From 5eb740b866fc95f6eca2501686e45d28f1671b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Tue, 14 Apr 2020 03:05:43 +0200 Subject: [PATCH 05/14] Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 2f8dfbed..137d45a8 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username -custom: ['https://www.paypal.me/samuelstancl', 'https://gumroad.com/l/tenancy'] +custom: ['https://github.com/stancl/tenancy/blob/2.x/DONATIONS.md', 'https://www.paypal.me/samuelstancl', 'https://gumroad.com/l/tenancy'] From bfbcd926085f4dfafc35dc6affddbfd3860cd28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Tue, 14 Apr 2020 03:32:33 +0200 Subject: [PATCH 06/14] Add patreon --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 137d45a8..6b725bb4 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,7 +1,7 @@ # These are supported funding model platforms # github: stancl -patreon: # Replace with a single Patreon username +patreon: samuelstancl open_collective: # Replace with a single Open Collective username ko_fi: samuelstancl tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel From a915dadba3a9664dc9a54789f771f13e6bf615c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Tue, 14 Apr 2020 03:33:23 +0200 Subject: [PATCH 07/14] Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 6b725bb4..9b362dcf 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username -custom: ['https://github.com/stancl/tenancy/blob/2.x/DONATIONS.md', 'https://www.paypal.me/samuelstancl', 'https://gumroad.com/l/tenancy'] +custom: ['https://www.paypal.me/samuelstancl', 'https://gumroad.com/l/tenancy'] From 983a5ecf6ca86fd9b2dfbcb212ce640ef380c026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Thu, 16 Apr 2020 22:26:52 +0200 Subject: [PATCH 08/14] Add patreon link --- DONATIONS.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DONATIONS.md b/DONATIONS.md index 0b0cb90f..99505271 100644 --- a/DONATIONS.md +++ b/DONATIONS.md @@ -4,9 +4,13 @@ Any donations will be greatly appreciated and help ensure that the package is de If you're a company and this package is helping you make money, please consider donating. +### Patreon + +If you would like to support me on a monthly basis, you can use Patreon: https://patreon.com/samuelstancl + ### PayPal -PayPal is the preferable donation method as it comes with the lowest fees. +PayPal is the preferable donation method for one-time donations as it comes with the lowest fees. You can donate here: [https://paypal.me/samuelstancl](https://paypal.me/samuelstancl) From 4a537672d89148effdb7aba48ec33feab77e308e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Fri, 17 Apr 2020 00:14:11 +0200 Subject: [PATCH 09/14] Add TransferWise & edit mail links --- DONATIONS.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/DONATIONS.md b/DONATIONS.md index 99505271..e1e9efe9 100644 --- a/DONATIONS.md +++ b/DONATIONS.md @@ -20,11 +20,17 @@ If you can't use PayPal, you may use my Gumroad link. This comes with higher fee You can donate here: [https://gumroad.com/l/tenancy](https://gumroad.com/l/tenancy) +### Bank transfer + +If you'd like to donate money from your bank account, you can can do that too. I use [TransferWise](https://transferwise.com/invite/u/samuels1719) (affiliate link 🙂), so I can accept bank transfers in virtually any currency. + +Contact me on [samuel.stancl@gmail.com](mailto:samuel.stancl@gmail.com?subject=Donation) and I'll give you bank details for your local currency. + ### Legal If you're a business making a donation, you may want an invoice. -Contact me on [samuel.stancl@gmail.com](mailto:samuel.stancl@gmail.com) and let me know what you need to have on the invoice and I will make it happen. +Contact me on [samuel.stancl@gmail.com](mailto:samuel.stancl@gmail.com?subject=Donation%20with%20invoice) and let me know what you need to have on the invoice and I will make it happen. ### Thank you! From cb6661210fcc22ff46bb04a8994f5fb6060af33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Wed, 22 Apr 2020 22:31:51 +0200 Subject: [PATCH 10/14] Make sure an int exit code is always returned --- src/Traits/TenantAwareCommand.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Traits/TenantAwareCommand.php b/src/Traits/TenantAwareCommand.php index e86168df..fb11df9f 100644 --- a/src/Traits/TenantAwareCommand.php +++ b/src/Traits/TenantAwareCommand.php @@ -14,14 +14,8 @@ trait TenantAwareCommand protected function execute(InputInterface $input, OutputInterface $output) { $tenants = $this->getTenants(); - - if (count($tenants) === 1) { - return $tenants[0]->run(function () { - return $this->laravel->call([$this, 'handle']); - }); - } - $exitCode = 0; + foreach ($tenants as $tenant) { $result = (int) $tenant->run(function () { return $this->laravel->call([$this, 'handle']); From 721d0669c508c66156fdb3313ab2fce3b1ee27b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Wed, 22 Apr 2020 23:33:00 +0200 Subject: [PATCH 11/14] Set up GitHub Actions --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..42f2b337 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: CI + +on: + push: + branches: [ v2 ] + pull_request: + branches: [ v2 ] + +jobs: + tests: + runs-on: ubuntu-latest + + strategy: + matrix: + laravel: ["^6.0", "^7.0"] + + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: travis_retry docker-compose exec test composer require --no-interaction "laravel/framework:$LARAVEL_VERSION" + - name: Run tests + run: ./fulltest + - name: Send code coverage to codecov + env: + CODECOV_TOKEN: 24382d15-84e7-4a55-bea4-c4df96a24a9b + run: bash <(curl -s https://codecov.io/bash) From 5cc357816237383d7a1d872cdd8486387fad1ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Wed, 22 Apr 2020 23:33:57 +0200 Subject: [PATCH 12/14] Update branch names --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42f2b337..b8461601 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [ v2 ] + branches: [ 2.x ] pull_request: - branches: [ v2 ] + branches: [ 2.x ] jobs: tests: From c8b2113eb4617203c7f31d4e900e274a9380c3a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Wed, 22 Apr 2020 23:34:54 +0200 Subject: [PATCH 13/14] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8461601..0e27fb6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install dependencies - run: travis_retry docker-compose exec test composer require --no-interaction "laravel/framework:$LARAVEL_VERSION" + run: docker-compose exec test composer require --no-interaction "laravel/framework:$LARAVEL_VERSION" - name: Run tests run: ./fulltest - name: Send code coverage to codecov From 7eb3395807c689a74ce4f6303afa93ce8c8ee25c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Wed, 22 Apr 2020 23:36:06 +0200 Subject: [PATCH 14/14] Add docker-compose up -d --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e27fb6e..7dcde1af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,8 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Start docker containers + run: docker-compose up -d - name: Install dependencies run: docker-compose exec test composer require --no-interaction "laravel/framework:$LARAVEL_VERSION" - name: Run tests