summaryrefslogtreecommitdiff
path: root/vendor/illuminate/support/Collection.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/illuminate/support/Collection.php')
-rw-r--r--vendor/illuminate/support/Collection.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/vendor/illuminate/support/Collection.php b/vendor/illuminate/support/Collection.php
index e9e073b418..7b5c58e68e 100644
--- a/vendor/illuminate/support/Collection.php
+++ b/vendor/illuminate/support/Collection.php
@@ -679,7 +679,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
}
/**
- * Filter items where the given key between values.
+ * Filter items such that the value of the given key is between the given values.
*
* @param string $key
* @param array $values
@@ -691,6 +691,20 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
}
/**
+ * Filter items such that the value of the given key is not between the given values.
+ *
+ * @param string $key
+ * @param array $values
+ * @return static
+ */
+ public function whereNotBetween($key, $values)
+ {
+ return $this->filter(function ($item) use ($key, $values) {
+ return data_get($item, $key) < reset($values) || data_get($item, $key) > end($values);
+ });
+ }
+
+ /**
* Filter items by the given key value pair.
*
* @param string $key