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
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. |
||
|---|---|---|
| .github | ||
| art | ||
| assets | ||
| src | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .styleci.yml | ||
| composer.json | ||
| CONTRIBUTING.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| DONATIONS.md | ||
| LICENSE | ||
| phpunit.xml | ||
| README.md | ||
| SUPPORT.md | ||
| test | ||
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
- Package created by Samuel Štancl
- Design help & current logo by Florian Karsten
