allocation_limit), DisplayException::class, 'You cannot delete allocations for this server: no allocation limit is set.'); throw_if($allocation->id === $server->allocation_id, DisplayException::class, 'You cannot delete the primary allocation for this server.'); Allocation::query()->where('id', $allocation->id)->update([ 'notes' => null, 'server_id' => null, ]); Activity::event('server:allocation.delete') ->subject($server, $allocation) ->property('allocation', $allocation->toString()) ->log(); return $allocation->refresh(); } }