mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 21:34:03 +00:00
Shared users - complete
This commit is contained in:
parent
daae67c0f7
commit
b7c8f1fba7
12 changed files with 488 additions and 56 deletions
15
src/Database/Models/TenantPivot.php
Normal file
15
src/Database/Models/TenantPivot.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Stancl\Tenancy\Database\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
|
||||
class TenantPivot extends Pivot
|
||||
{
|
||||
public static function booted()
|
||||
{
|
||||
static::saved(function (self $pivot) {
|
||||
$pivot->pivotParent->triggerSyncEvent();
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue