public static function cast($collection, string $restrictTo = null)
    {
        if ($collection instanceof Collection) {
            return $collection;
        }

        return new static($collection, $restrictTo);
    }
public static function cast($collection, string $restrictTo = null)
    {
        if ($collection instanceof Collection) {
            return $collection;
        }

        return new static($collection, $restrictTo);
    }
public static function cast ( $ collection , string $ restrictTo = null ) { if ( $ collection instanceof Collection ) { return $ collection ; } return new static ( $ collection , $ restrictTo ) ; }
Convert a value to a Collection instance

@param mixed       $collection mixed Value can be a single value, an array or a Collection
@param string|null $restrictTo Restricts the values of the collection to a given type

@return static
Convert a value to a Collection instance