Implemented Dynamic Items for data to be sent to polled systems based on data in db, like stats/nodelists

This commit is contained in:
2023-12-03 18:18:05 +11:00
parent 8f3d77b04d
commit 1890b66dc7
10 changed files with 366 additions and 4 deletions

View File

@@ -242,6 +242,11 @@ class Address extends Model
->with(['zone.domain']);
}
public function dynamics()
{
return $this->hasMany(Dynamic::class);
}
/**
* Echoareas this address is subscribed to
*
@@ -691,6 +696,19 @@ class Address extends Model
}
}
/**
* Files waiting to be sent to this system
*
* @return Collection
*/
public function dynamicWaiting(): Collection
{
return $this->dynamics()
->where('next_at','<=',Carbon::now())
->where('active',TRUE)
->get();
}
/**
* Echomail waiting to be sent to this system
*