src/Bag.php
public function findKey(callable $predicate, $fromIndex = 0)
    {
        foreach ($this->iterateFromIndex($fromIndex) as $key => $value) {
            if ($predicate($value, $key)) {
                return $key;
            }
        }

        return null;
    }
public function findKey(callable $predicate, $fromIndex = 0)
    {
        foreach ($this->iterateFromIndex($fromIndex) as $key => $value) {
            if ($predicate($value, $key)) {
                return $key;
            }
        }

        return null;
    }
Returns the first key that matches the `$predicate` or null.

@param callable $predicate Function is passed `($value, $key)`
@param int      $fromIndex The starting index to search from.
Can be negative to start from that far from the end of the array.
If index is out of bounds, it will be moved to first/last index.

@return mixed|null