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 f7d9f02fd4
Improve route cloning action (#8)
* Allow cloning routes when only kernel identification is used, explicitly enable specific cloning modes

* Explicitly enable needed clone modes in tests, use "clone" instead of "reregister"

* Fix code style (php-cs-fixer)

* Use  "cloning" instead of "re-registration" in UniversalRouteTest

* Only clone routes using path identification

* Revert clone mode changes

* Fix code style (php-cs-fixer)

* Update comment

* Skip cloning 'stancl.tenancy.asset' by default

* Decide which routes should get cloned in the filtering step, improve method organization

* Return `RouteMode::UNIVERSAL` in getMiddlewareContext if route is universal

* Give universal route the path ID MW so that it gets cloned

* Fix code style (php-cs-fixer)

* Simplify UsableWithEarlyIdentification code

* Handle universal route mode in ForgetTenantParameter

* Fix code style (php-cs-fixer)

* Rename getMiddlewareContext to getRouteMode

* Append '/' to the route prefix

* Rename variable

* Wrap part of condition in parentheses

* Refresh name lookups after cloning routes

* Test giving tenant flag to cloned routes

* Add routeIsUniversal method

* Correct ForgetTenantParameter condition

* Improve tenant flag giving logic

* Improve test name

* Delete leftover testing code

* Put part of condition into `()`

* Improve CloneRoutesAsTenant code + comments

* Extract route mode-related code into methods, refactor and improve code

* Improve ForgetTenantParameter, test tenant parameter removing in universal routes

* Fix code style (php-cs-fixer)

* Fix test

* Simplify adding tenant flag

* Don't skip stancl.tenancy.asset route cloning

* clean up comment

* fix in_array() argument

* Fix code style (php-cs-fixer)

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2023-08-28 13:17:17 +02: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 Improve route cloning action (#8) 2023-08-28 13:17:17 +02:00
doctum wip 2023-04-14 17:23:19 +02:00
src Improve route cloning action (#8) 2023-08-28 13:17:17 +02:00
tests Improve route cloning action (#8) 2023-08-28 13:17:17 +02: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 Cache prefix mode for separating tenant caches (#1014) 2023-04-24 16:25:51 +02: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