1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 14:14:04 +00:00
Automatic multi-tenancy for Laravel. No code changes needed. https://tenancyforlaravel.com
Find a file
lukinovec e25e7b7961
Single-domain tenants (#16)
* Add SingleDomainTenant

* Add logic for single domain tenants

* Test that the single domain approach works (wip)

* Fix code style (php-cs-fixer)

* Simplify SubdomainTest tests

* Add single domain tenant conditions to DomainTenantResolver

* Test single domain tenants in resolver test

* Fix test name typo

* Improve runUsingBothDomainApproaches()

* Delete extra tenancy()->end()

* Test early identification with both domain approaches

* Test that things work with both domain approaches in the rest of the tests

* Fix falsely passing test

* Fix PHPStan errors

* Change SingleDomainTenant to a contract, add SingleDomainTenant test model

* Fix TenantList domainsCLI()

* Improve setCurrentDomain() check

* Fix code style (php-cs-fixer)

* Add annotation

* Revert getCustomColumns() change

* Add comments

* Use the domain returned by the closure in runUsingBoth..()

* Delete `migrate` from test

* Improve test names

* Use variable instead of repeating the same string multiple times

* Update comment

* Add comment

* Clean up PreventAccess test

* Don't assign domain to a single-use variable

* Update comments

* Uncomment datasets

* Add todo

* Fix user impersonation test

* Don't specify tenant key when creating tenant in runUsingBoth..()

* Improve universal route test

* Improve `runUsingBothDomainApproaches()`

* Add tests specific to single domain tenants

* Get rid of the runUsingBothDomainApproaches method

* Add test file specific for the single domain tenant feature

* Rename test

* Make getCustomColumns() function static

* Positiopn datasets differently

* Fix early id test

* Add prevent MW to route MW in test

* Fix single domain tenant tests

* Delete SingleDomainTenantTest (CI testing)

* Add the test file back

* TUrn APP_DEBUG on temporarily

* Turn debug off

* Try creating tenant with non-unique domain (CI testing)

* dd duplicate tenant records

* Revert testing change

* Make SingleDomainTenant not extend base tenant (VirtualColumn issues)

* Fix early id test

* add todo

* Use dev-master stancl/virtualcolumn

* Make SingleDomainTenant extend the tenant base model

* remove todo

* Clean up EarlyIdentificationTest changes

* Finish test file cleanup

* Fix test

* improve test

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2023-11-08 11:38:26 +01:00
.github Cache prefix mode for separating tenant caches (#1014) 2023-04-24 16:25:51 +02:00
art Update artwork 2020-06-09 15:36:47 +02:00
assets Correct asset helpers, make asset helpers work with path identification (#6) 2023-08-31 15:44:26 +02:00
doctum wip 2023-04-14 17:23:19 +02:00
src Single-domain tenants (#16) 2023-11-08 11:38:26 +01:00
tests Single-domain tenants (#16) 2023-11-08 11:38:26 +01:00
.gitattributes Rewrite cached resolver logic to allow for cache invalidation logic 2020-06-02 20:10:17 +02:00
.gitignore [4.x] Add pending tenants (modified #782) (#869) 2022-10-31 12:14:44 +01:00
.php-cs-fixer.php [4.x] Add command to bring the tenants up and down from maintenance and remove deprecated exception (#761) 2022-09-29 15:59:14 +02:00
composer.json Single-domain tenants (#16) 2023-11-08 11:38:26 +01:00
CONTRIBUTING.md Fix #998, properly replace ALL tenant_id literals 2022-11-10 16:44:52 +01:00
docker-compose-m1.override.yml Better M1 DX 2022-07-22 22:29:56 +02:00
docker-compose.yml Fix #1112 - throw an exception if DATABASE_URL is set (#9) 2023-08-18 20:21:00 +02:00
Dockerfile specify version of odbc libraries 2023-02-16 17:20:55 +01:00
DONATIONS.md update md files 2020-06-08 22:42:13 +02:00
INTERNAL.md revert to 8.1 in CI for now 2023-01-04 03:04:00 +01:00
LICENSE Initial commit 2019-01-17 22:24:12 +01:00
phpstan.neon Add L10 support to 4.x (merge 3.x to master) (#1071) 2023-02-20 23:47:10 +01:00
phpunit.xml Add SessionTenancyBootstrapper (#2) 2022-11-20 02:32:25 +01:00
README.md Update README.md 2022-05-01 12:56:25 +02:00
SUPPORT.md Discord link 2022-06-13 19:16:35 +02:00
t [4.x] Add feature to ignore the resource synchronization based on provided condition. (#993) 2022-11-04 15:04:29 +01:00
test [4.x] Migrate tests to Pest (#884) 2022-07-22 19:26:59 +02:00

Tenancy for Laravel logo

Laravel 9.x Latest Stable Version GitHub Actions CI status Donate

Tenancy for Laravel — stancl/tenancy

Automatic multi-tenancy for your Laravel app.

You won't have to change a thing in your application's code.

  • ✔️ No model traits to change database connection
  • ✔️ No replacing of Laravel classes (Cache, Storage, ...) with tenancy-aware classes
  • ✔️ Built-in tenant identification based on hostname (including second level domains)

Documentation

Documentation can be found here: https://tenancyforlaravel.com/docs/v3/

The repository with the documentation source code can be found here: stancl/tenancy-docs.

Need help?

Credits