Closed edwinvdpol closed 2 months ago
This is expected behavior, as per the documentation:
The search method searches the collection for the given value and returns its key if found. If the item is not found, false is returned.
I have also confirmed the same results using Laravel's Collection.
You are using all strings in your collection, so there is no reason to pass true
as the second parameter.
This issue should be closed.
Hi there,
I already saw a few issues which were related to
search
, but can someone explain this behaviour? I am searching for a string value.Am I doing to something wrong here?
Thanks, Edwin