Update IP reservation logic to include 'reserved' status in available IPs

This commit is contained in:
baodev0
2026-07-13 12:08:42 +07:00
parent 3403cb9ec5
commit fdb5714e93
@@ -304,9 +304,7 @@ class AssignIpToGuestJob implements ShouldQueue
->toArray(); ->toArray();
$ipPool = IpPool::where('module_network_id', $networkId) $ipPool = IpPool::where('module_network_id', $networkId)
->where('status', 'free') ->whereIn('status', ['free', 'reserved'])
->whereNotNull('gateway')
->where('gateway', '!=', '')
->whereNotIn('ip_address', $usedIps) ->whereNotIn('ip_address', $usedIps)
->lockForUpdate() ->lockForUpdate()
->inRandomOrder() ->inRandomOrder()