src/Concerns/ChainsResults.php
protected function valueIsChainable($value): bool
    {
        $chainableObjects = $this->getChainableObjects();
        if (! is_object($value)) {
            return false;
        } elseif (in_array('object', $chainableObjects)) {
            return true;
        } else {
            $isInstanceOf = function (string $chainable) use ($value) {
                return $value instanceof $chainable;
            };
            return count(array_filter($chainableObjects, $isInstanceOf)) !== 0;
        }
    }
protected function valueIsChainable($value): bool
    {
        $chainableObjects = $this->getChainableObjects();
        if (! is_object($value)) {
            return false;
        } elseif (in_array('object', $chainableObjects)) {
            return true;
        } else {
            $isInstanceOf = function (string $chainable) use ($value) {
                return $value instanceof $chainable;
            };
            return count(array_filter($chainableObjects, $isInstanceOf)) !== 0;
        }
    }
Whether or not the given value is a chainable object.

@param mixed $value
@return bool