1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 12:54:05 +00:00
Automatic multi-tenancy for Laravel. No code changes needed. https://tenancyforlaravel.com
Find a file
Elísio Leonardo fb44f3288d
Syncing resources fails when table structures differ
When syncing resources, this line $centralModel = $event->model->getCentralModelName()::create($event->model->getAttributes()); fails in two situations:

1. when there are column(s) in tenant table that are not in central table.
2. when there is already a row in central table with same id as the id generated while creating the model on tenant table(With ID i mean primary key which my differ from Global ID column).

With this change, only syncedAttributes will be used while creating the model on central table. unfortunatelly, with this we lose the hability to populate the row with default values and all required columns must be on $syncedAttributes, but is the only way I could get it to work.
2021-06-26 15:36:43 +02:00
.github Update bug-report.md 2020-12-11 08:29:36 +01:00
art Update artwork 2020-06-09 15:36:47 +02:00
assets Fix array_unique causing problems in TenancyServiceProvider stub (#672) 2021-06-15 20:43:53 +02:00
src Syncing resources fails when table structures differ 2021-06-26 15:36:43 +02:00
tests Terminating pipelines (#527) 2020-11-15 16:26:26 +01:00
.gitattributes Rewrite cached resolver logic to allow for cache invalidation logic 2020-06-02 20:10:17 +02:00
.gitignore add gitattr (#392) 2020-05-04 19:14:12 +02:00
.styleci.yml risky: true 2020-08-03 14:40:54 +02:00
composer.json PHP 8 support (#542) 2020-11-30 17:30:42 +01:00
CONTRIBUTING.md Fix issue 521: Array input for --tenants (#522) 2020-11-12 14:08:37 +01:00
docker-compose.yml Simplify docker build, use stable PHP 8 image 2020-12-01 18:20:25 +01:00
Dockerfile PHP 8 support (#542) 2020-11-30 17:30:42 +01:00
DONATIONS.md update md files 2020-06-08 22:42:13 +02:00
LICENSE Initial commit 2019-01-17 22:24:12 +01:00
phpunit.xml Updated some docker stuff (#409) 2020-05-22 18:09:07 +02:00
README.md fix badge url 2021-01-16 21:30:48 +01:00
SUPPORT.md Update SUPPORT.md 2020-07-12 15:03:52 +02:00
test vague first draft of v3. TenantModelTest is passing 2020-05-08 04:37:43 +02:00

Tenancy for Laravel logo

Laravel 6.x/7.x/8.x Latest Stable Version GitHub Actions CI status codecov 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