diff --git a/src/Illuminate/Collections/Enumerable.php b/src/Illuminate/Collections/Enumerable.php index 4bda35476905..29b123d53525 100644 --- a/src/Illuminate/Collections/Enumerable.php +++ b/src/Illuminate/Collections/Enumerable.php @@ -808,6 +808,19 @@ public function slice($offset, $length = null); */ public function split($numberOfGroups); + /** + * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. + * + * @param mixed $key + * @param mixed $operator + * @param mixed $value + * @return mixed + * + * @throws \Illuminate\Collections\ItemNotFoundException + * @throws \Illuminate\Collections\MultipleItemsFoundException + */ + public function sole($key = null, $operator = null, $value = null); + /** * Chunk the collection into chunks of the given size. *