GithubHelp home page GithubHelp logo

ipinfo / laravel Goto Github PK

View Code? Open in Web Editor NEW
157.0 157.0 35.0 673 KB

Official Laravel client library for IPinfo API (IP geolocation and other types of IP data)

Home Page: https://ipinfo.io

License: Apache License 2.0

PHP 83.10% Blade 16.90%
ip-address ip-data ip-geolocation ipinfo laravel

laravel's Issues

Use versioned cache key

Make sure the cache key contains a number to indicate the version of the cached data. Data changes that change what's expected in cached data require a version change.

Add optional IP selection handler

Add an optional IP selection handler to the SDK client initialization step which accepts the request context and expects returning an IP.

The default handler, if no handler is specified by the user, will simply return the IP attached to the request object.

An additional handler should be available within the library, which looks into the X-Forwarded-For header and gets the first IP in the list if it exists, falling back to the IP attached to the request if the header isn't available. This is an implementation that users can optionally use instead of making their own.

Handling exceptions

I would like the option to easily handle exceptions. Sometimes ipinfo throws a random exception (when the service is temporarily unavailable for example). But it results immediately in production a 500 error.

I would like the option to set a parameter that exceptions can be ignored and logged. So the application still continues working. And that $request->ipinfo just returns an empty object.

Currently there is no easy way to handle those exceptions.

Get data from public ip

this is the response i get when i run $ request-> ipinfo

asdasd

How can I get the data from my public ip?

Laravel 10 Support?

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires ipinfo/ipinfolaravel ^2.4 -> satisfiable by ipinfo/ipinfolaravel[v2.4.0].
    - ipinfo/ipinfolaravel v2.4.0 requires illuminate/support >=5, <10 -> found illuminate/support[v5.0.0, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.4] but these were not loaded, likely because it conflicts with another require.

You can also try re-running composer require with an explicit version constraint, e.g. "composer require ipinfo/ipinfolaravel:*" to figure out if any version is installable, or "composer require ipinfo/ipinfolaravel:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

following instructions from #40 (comment) causes even more errors to throw

Error

Hi, i get this error not every tme
count(): Parameter must be an array or an object that implements Countable
Any idea?
Thanks.

Get ip of the user

With: $request->ipinfo->country I get the details of the server not of the user.

How do I pass $request->getClientIp(); to ipinfo?

Laravel 9 compatibility

Your requirements could not be resolved to an installable set of packages.

Problem 1
- sabre/cache[1.0.0, ..., 1.0.4] require psr/simple-cache ^1.0 -> found psr/simple-cache[1.0.0, 1.0.1] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- sabre/cache 1.0.2 requires php ^7.1 -> your php version (8.0.20) does not satisfy that requirement.
- ipinfo/ipinfolaravel v2.4.0 requires ipinfo/ipinfo ^2.3.1 -> satisfiable by ipinfo/ipinfo[v2.3.1, 2.3.x-dev].
- ipinfo/ipinfo[v2.3.1, ..., 2.3.x-dev] require sabre/cache ^1.0 -> satisfiable by sabre/cache[1.0.0, ..., 1.0.4].
- Root composer.json requires ipinfo/ipinfolaravel ^2.4 -> satisfiable by ipinfo/ipinfolaravel[v2.4.0].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require ipinfo/ipinfolaravel:*" to figure out if any version is installable, or "composer require ipinfo/ipinfolaravel:^2.1" if you know which you need.

Laravel 11 compatibility

Cannot be used with Laravel 11

Problem 1
- ipinfo/ipinfolaravel v1.0.0 requires illuminate/support ~5 -> found illuminate/support[v5.0.0, ..., v5.8.36] but these were not loaded, likely because it conflicts with another require.
- ipinfo/ipinfolaravel[v2.0.0, ..., v2.2.0] require illuminate/support >=5, <9 -> found illuminate/support[v5.0.0, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
- ipinfo/ipinfolaravel[v2.3.0, ..., v2.4.0] require illuminate/support >=5, <10 -> found illuminate/support[v5.0.0, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0-beta.1, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require.
- ipinfo/ipinfolaravel[v2.5.0, ..., v2.6.0] require illuminate/support >=7 <11 -> found illuminate/support[v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0-beta.1, ..., v9.52.16, v10.0.0, ..., v10.48.4] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires ipinfo/ipinfolaravel * -> satisfiable by ipinfo/ipinfolaravel[v1.0.0, v2.0.0, ..., v2.6.0].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.