allocations() ->whereIn('id', $request->validated('ids', [])) ->lockForUpdate() ->get(); $allocations->each(fn (Allocation $allocation) => $deletions->delete($allocation)); return $allocations; }); foreach ($allocations as $allocation) { Activity::event('admin:node-allocation.delete') ->subject($allocation) ->property('address', $allocation->ip) ->property('port', $allocation->port) ->log(); } return $this->returnNoContent(); } }