$collection->indexOf()
Correct position detection for objects. The method will automatically detect objects or ids and then search accordingly.
$collection->indexOf(string|mixed $needle): int|false
Parameters
| Name | Type | Default |
|---|---|---|
| $needlerequired | stringormixed |
no default value |
Return types
intorfalse