Is there an analogue of array_search in laravel collections?

Good afternoon.
The collections found only the contains method, which returns true if the element was found in the collection or false if not found. I need a method that would be in the case of finding the element would return the key of this array. A few times I leafed through the documentation for the collections - but something did not find anything suitable, maybe .each, but it will have a bunch of unnecessary writing if the analogue array_search is still there.
April 4th 20 at 00:52
2 answers
April 4th 20 at 00:54
Solution
Decided method ->where(). In two-dimensional arrays, apparently, is the only option. Although it is quite handy.. thank you)
April 4th 20 at 00:56
Method search() looks for in a collection the specified value and returns its key successful search.....
I didn't say search() searches only in the one-dimensional collections. In a two-dimensional already can't find the value.. - Dannie.Nienow83 commented on April 4th 20 at 00:59

Find more questions by tags Laravel