mirror of
https://github.com/archtechx/tenancy.git
synced 2026-06-21 19:24:04 +00:00
Remove detailed tenancy references from boost resources for better clarity and maintainability
This commit is contained in:
parent
fde2bf0cf4
commit
882eaef8b4
20 changed files with 0 additions and 0 deletions
|
|
@ -0,0 +1,32 @@
|
|||
# Resource Syncing Reference
|
||||
|
||||
Use this when syncing central resources into tenant contexts.
|
||||
|
||||
## Source Files
|
||||
|
||||
- `src/ResourceSyncing/*`
|
||||
- `assets/resource-syncing-migrations/*`
|
||||
- `assets/TenancyServiceProvider.stub.php`
|
||||
|
||||
## Setup
|
||||
|
||||
Publish resource syncing migration:
|
||||
|
||||
```bash
|
||||
php artisan vendor:publish --provider="Stancl\Tenancy\TenancyServiceProvider" --tag=resource-syncing-migrations
|
||||
php artisan migrate
|
||||
```
|
||||
|
||||
## Main Pieces
|
||||
|
||||
- `tenant_resources` table.
|
||||
- `ResourceSyncing` classes and listeners.
|
||||
- `SyncMaster`, `Syncable`, `TenantPivot`, `TenantMorphPivot`.
|
||||
- Events such as `SyncedResourceSaved`, `SyncedResourceDeleted`, `CentralResourceAttachedToTenant`.
|
||||
|
||||
## Rules
|
||||
|
||||
- Use package events/listeners instead of custom tenant loops.
|
||||
- Keep central and tenant resource lifecycles explicit.
|
||||
- Configure soft-delete query behavior in the application `TenancyServiceProvider` when needed.
|
||||
- Test create, update, delete, restore, attach, and detach behavior.
|
||||
Loading…
Add table
Add a link
Reference in a new issue