PHPackages                             nawrasbukhari/geo-content - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nawrasbukhari/geo-content

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nawrasbukhari/geo-content
=========================

GeoContent is a Laravel package that provides a simple way to manage your content based on the user's location.

0.2.0(2y ago)010MITPHPPHP ^8.1

Since Aug 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/NawrasBukhari/geo-content)[ Packagist](https://packagist.org/packages/nawrasbukhari/geo-content)[ Docs](https://github.com/NawrasBukhari/GeoContent)[ RSS](/packages/nawrasbukhari-geo-content/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (13)Versions (3)Used By (0)

Laravel Geo-Content Package
===========================

[](#laravel-geo-content-package)

---

The Laravel Geo-Content package provides a convenient way to fetch geolocation information using the FreeIPAPI service. This package is designed to retrieve geolocation data for IP addresses, including details such as country name, country code, continent, and more.

Installation
------------

[](#installation)

```
composer require nawrasbukhari/geo-content
```

You can publish the config file with:

```
php artisan vendor:publish --tag="geo-content-config"
```

This is the contents of the published config file:

```
return [
    'freeipapi_base_url' => env('FREEIPAPI_BASE_URL', 'https://freeipapi.com/api/json/'),
    'freeipapi_key' => env('FREEIPAPI_KEY'),
    'freeipapi_ssl' => env('FREEIPAPI_SSL', false),
    'timeout' => env('FREEIPAPI_TIMEOUT', 30),
    'testing_ip_address' => env('FREEIPAPI_TESTING_IP_ADDRESS', '208.67.222.222'),
    'usual_localhost_ip' => [
        '127.0.0.1',
        '::1',
        'localhost',
    ],
];
```

Usage
-----

[](#usage)

Show content only to users from the United States

```
use NawrasBukhari\GeoContent\Facades\GeoContent;

$geoContent = new GeoContent();

if ($geoContent->country('United States of America')) {
    // Display restricted content here
}
```

Allowing Content for Specific Continents Similarly, you can use the continent method to display content exclusively to users from particular continents:

```
use NawrasBukhari\GeoContent\Facades\GeoContent;

$geoContent = new GeoContent();

if ($geoContent->continent('AM')) {
    // Display restricted content here
}
```

Disallowing Content for Specific Countries You can use the `onlyShowInCountry()` or `onlyShowInCountryCode()` method to display content to users from specific country

```
use NawrasBukhari\GeoContent\Facades\GeoContent;

// Create an instance of the GeoContent class
$geoContent = new GeoContent();

// Hide content from users in Russia
if ($geoContent->onlyShowInCountry('Russia')) {
    // Display non-restricted content here for users from Russia
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Free IP API](https://freeipapi.com)
- [Spatie skeleton](https://github.com/spatie/package-skeleton-laravel)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1057d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/40843430?v=4)[nbukhari](/maintainers/nbukhari)[@nbukhari](https://github.com/nbukhari)

---

Top Contributors

[![NawrasBukhari](https://avatars.githubusercontent.com/u/63796900?v=4)](https://github.com/NawrasBukhari "NawrasBukhari (5 commits)")

---

Tags

laravellaravel-packageGeoContentfreeipapi

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/nawrasbukhari-geo-content/health.svg)

```
[![Health](https://phpackages.com/badges/nawrasbukhari-geo-content/health.svg)](https://phpackages.com/packages/nawrasbukhari-geo-content)
```

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

199.4k](/packages/tarfin-labs-event-machine)[tapp/filament-form-builder

User facing form builder using Filament components

132.4k3](/packages/tapp-filament-form-builder)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
