8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c0a3169 commit e769e3dCopy full SHA for e769e3d
src/Illuminate/Collections/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