1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-06 09:34:04 +00:00
This commit is contained in:
Abrar Ahmad 2022-11-04 12:08:35 +05:00
parent 77c5ae1f32
commit f13460d91f
3 changed files with 46 additions and 2 deletions

View file

@ -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;
}
}