laravel-timezone
laravel-timezone copied to clipboard
The library does not take the first found IP from 'lookup' config key
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;
}
I've prepared a small PR for this: https://github.com/jamesmills/laravel-timezone/pull/79