1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 12:44:02 +00:00
Automatic multi-tenancy for Laravel. No code changes needed. https://tenancyforlaravel.com
Find a file
lukinovec 4ead17a56b
[4.x] TableRLSManager refactor, comment constraints (#1354)
* Add option to provide constraint information in column comment

* Fix code style (php-cs-fixer)

* Correct comment functionality, add comment constraint exception

* Simplify and clarify comment-related TableRLSManager code

* Make path skipping logic more explicit

* Correct terminology, add test for throwing exceptions

* Fix code style (php-cs-fixer)

* Improve comments

* Refactor TableRLSManagerr (dynamic programming, deal with recursive relationships, determine shortest paths while generating the paths)

* Fix code style (php-cs-fixer)

* Improve TableRLSManager comments

* Test uncovered edge cases

* Improve code for determining the shortest path

* Improve readability

* Fix code style (php-cs-fixer)

* Update the tree terminology

* Use consistent shortest path terminology

* Improve comment

* Improve method name

* Simplify and clarify core shortest path generation test

* Clarify and simplify tests, add comments

* Delete excessive test

* Test data separation with comment constraints

* Use tenant id instead of getTenantKey()

* Make higher-level code clearer, improve comments

* Improve comments, delete excessive methods, make methods more concise, position helper methods more appropriately

* Fix code style (php-cs-fixer)

* Add a "single source of truth" for path array format, make lower-level code more concise, improve comments

* Fix code style (php-cs-fixer)

* Correct terminology and comments in TableRLSManager

* Correct terminology in table manager test file

* Improve comments and method name

* Fix typo

* bump php memory limit when running tests

* Delete findShortestPath, merge the code into shortestPathToTenantsTabke

* Minor shortestPathToTenantsTable improvement

* Improve docblocks,as discussed

* Move RLSCommentConstraintException to src/RLS/Exceptions

* Fully cover shouldSkipPathLeadingThrough in tests

* test improvements

* tests: add comment to clarify the chosen path

* formatting

* Fix typo

* Use `===` instead of `Str::is()`

* Refactor constraint formatting in TableRLSManager

* Fix code style (php-cs-fixer)

* Update key names of the formatted constraints

* Rename shouldSkipPathLeadingThrough() to shouldSkipPathLeadingThroughConstraint()

* misc improvements

* code improvements

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2025-07-03 21:12:04 +02:00
.github [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
art Update artwork 2020-06-09 15:36:47 +02:00
assets [4.x] URL generation, request data identification improvements (#1357) 2025-06-02 03:43:47 +02:00
doctum wip 2023-04-14 17:23:19 +02:00
extensions [4.x] Add DisallowSqliteAttach feature (#1283) 2025-01-04 15:34:37 +01:00
src [4.x] TableRLSManager refactor, comment constraints (#1354) 2025-07-03 21:12:04 +02:00
tests [4.x] TableRLSManager refactor, comment constraints (#1354) 2025-07-03 21:12:04 +02:00
typedefs parallel commands: core # autodetect, bugfixes, improved output 2024-09-27 23:02:03 +02:00
.gitattributes parallel commands: core # autodetect, bugfixes, improved output 2024-09-27 23:02:03 +02:00
.gitignore Laravel 11 support + Docker improvements (#29) 2024-02-18 00:18:31 +01:00
.nvim.lua editor config: prevent tailwindcss LSP from starting in nvim [ci skip] 2024-04-22 21:27:53 +02:00
.php-cs-fixer.php Make RouteMode enum backed (#1362) 2025-06-02 20:34:49 +02:00
CLAUDE.md [4.x] URL generation, request data identification improvements (#1357) 2025-06-02 03:43:47 +02:00
composer.json remove ignition dependencies 2025-06-18 23:29:24 +02:00
CONTRIBUTING.md contributing note about mssql on Apple Silicon 2025-02-19 12:38:35 +01:00
docker-compose-m1.override.yml use mysql:8 in docker 2025-01-21 15:23:17 +01:00
docker-compose.yml contributing note about mssql on Apple Silicon 2025-02-19 12:38:35 +01:00
Dockerfile bump php version 2024-12-26 05:51:46 +01:00
DONATIONS.md update md files 2020-06-08 22:42:13 +02:00
INTERNAL.md [4.x] Add DisallowSqliteAttach feature (#1283) 2025-01-04 15:34:37 +01:00
LICENSE Initial commit 2019-01-17 22:24:12 +01:00
phpstan.neon phpstan fixes for spatie invader 2025-01-21 14:35:00 +01:00
phpunit.xml Misc test fixes (#44) 2024-04-06 19:17:34 +02:00
README.md prepare for public beta 2024-12-26 05:00:58 +01:00
SUPPORT.md Discord link 2022-06-13 19:16:35 +02:00
t [4.x] URL generation, request data identification improvements (#1357) 2025-06-02 03:43:47 +02:00
test [4.x] URL generation, request data identification improvements (#1357) 2025-06-02 03:43:47 +02:00

Tenancy for Laravel logo

Laravel 11.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://tenancy-v4.pages.dev/

Need help?

Credits