mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-06 09:34:04 +00:00
wip
This commit is contained in:
parent
77c5ae1f32
commit
f13460d91f
3 changed files with 46 additions and 2 deletions
|
|
@ -13,8 +13,10 @@ trait ResourceSyncing
|
|||
public static function bootResourceSyncing(): void
|
||||
{
|
||||
static::saved(function (Syncable $model) {
|
||||
/** @var ResourceSyncing $model */
|
||||
$model->triggerSyncEvent();
|
||||
dump($model->shouldSync());
|
||||
if ($model->shouldSync()) {
|
||||
$model->triggerSyncEvent();
|
||||
}
|
||||
});
|
||||
|
||||
static::creating(function (self $model) {
|
||||
|
|
@ -37,4 +39,9 @@ trait ResourceSyncing
|
|||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function shouldSync(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue