Skip to content

The library does not take the first found IP from 'lookup' config key #78

@boryn

Description

@boryn

At this moment, the library takes the last found IP from the 'lookup' config key. In documentation there is written "Having in mind when the key is found inside the attribute, that key will be used.", and I believe it should be the first taken.

I'd go with this changes to the lookup() method:

private function lookup($type, $keys)
    {
        $value = null;

        foreach ($keys as $key) {
            if (request()->$type->has($key)) {
                return request()->$type->get($key);
            }
        }

        return $value;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions