We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3adf132 commit ad3a118Copy full SHA for ad3a118
Enumerable.php
@@ -808,6 +808,19 @@ public function slice($offset, $length = null);
808
*/
809
public function split($numberOfGroups);
810
811
+ /**
812
+ * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception.
813
+ *
814
+ * @param mixed $key
815
+ * @param mixed $operator
816
+ * @param mixed $value
817
+ * @return mixed
818
819
+ * @throws \Illuminate\Collections\ItemNotFoundException
820
+ * @throws \Illuminate\Collections\MultipleItemsFoundException
821
+ */
822
+ public function sole($key = null, $operator = null, $value = null);
823
+
824
/**
825
* Chunk the collection into chunks of the given size.
826
*
0 commit comments