From 65d84efd0986f989fedd653a26eb71b76553022b Mon Sep 17 00:00:00 2001 From: Imani Manyara Date: Sat, 3 Oct 2026 15:19:04 -0400 Subject: [PATCH] Rename the quick start to Quick start guide and usage The README standard now splits the section into Getting started, the setup a fresh install needs before the first call, and Usage. Every command, tag and env key shown was checked against the package's own provider, config or CLI. --- README.md | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ba37b2..b7e6e2e 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,33 @@ composer require laranail/ip-intel Behind Cloudflare, Vercel, Fastly or CloudFront, a country lookup makes **no network call at all** — the edge already worked it out and put it in a request header. -## Quick start +## Quick start guide and usage + +### Getting started + +Nothing is required: the default chain is `['edge', 'local']`, both free and keyless. To widen it: + +1. **Offline tier.** Build `laranail/atlas`' registry table, then turn its IP lookup on: + + ```bash + php vendor/laranail/atlas/tools/build-ip-table.php + ``` + + ```dotenv + ATLAS_IP_LOOKUP=true + ``` + +2. **Metered tier** (city, ASN, threats). Publish the config, add `'ipapi'` to `chain`, and set the key: + + ```bash + php artisan vendor:publish --tag="laranail::ip-intel-config" + ``` + + ```dotenv + IP_INTEL_IPAPI_KEY=… + ``` + +### Usage ```php use Simtabi\Laranail\IpIntel\Facades\IpIntel; @@ -32,6 +58,15 @@ IpIntel::country('8.8.8.8'); // country only — the cheap path IpIntel::full('8.8.8.8'); // everything a configured source can supply ``` +Every call returns an `IpIntelResult`, never `null`: + +```php +$result = IpIntel::country('8.8.8.8'); + +$result->countryCode; // ?string +$result->madeNetworkCall; // false, when an edge header answered +``` + ## The chain is the point ```