Added system polling
This commit is contained in:
@@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
use App\Jobs\AddressPoll;
|
||||
|
||||
class System extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
@@ -214,4 +216,13 @@ class System extends Model
|
||||
return ($item->role & $type) && ($myzones->search($item->zone_id) !== FALSE);
|
||||
});
|
||||
}
|
||||
|
||||
public function poll(): ?Job
|
||||
{
|
||||
return Job::where('queue',AddressPoll::QUEUE)
|
||||
->get()
|
||||
->where(function($item) {
|
||||
return $this->akas->pluck('id')->search($item->command->address->id) !== FALSE; })
|
||||
->last();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user