Skip to content

Commit

Permalink
Quick bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NawrasBukhari committed Aug 11, 2023
1 parent 0a25bd5 commit 1b8754a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ return [

Show content only to users from the United States
```php
use NawrasBukhari\GeoContent\GeoContent;
use NawrasBukhari\GeoContent\Facades\GeoContent;

$geoContent = new GeoContent();

Expand All @@ -47,7 +47,7 @@ Allowing Content for Specific Continents
Similarly, you can use the continent method to display content exclusively to users from particular continents:

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

$geoContent = new GeoContent();

Expand All @@ -60,7 +60,7 @@ Disallowing Content for Specific Countries
You can use the `onlyShowInCountry()` or `onlyShowInCountryCode()` method to display content to users from specific country

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

// Create an instance of the GeoContent class
$geoContent = new GeoContent();
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"require": {
"php": "^8.1",
"illuminate/contracts": "^10.0",
"spatie/laravel-package-tools": "^1.14.0"
"spatie/laravel-package-tools": "^1.14.0",
"ext-curl": "*"
},
"require-dev": {
"laravel/pint": "^1.0",
Expand Down
7 changes: 1 addition & 6 deletions config/geo-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
return [
'freeipapi_base_url' => env('FREEIPAPI_BASE_URL', 'https://freeipapi.com/api/json/'),
'freeipapi_key' => env('FREEIPAPI_KEY'),
'freeipapi_ssl' => env('FREEIPAPI_SSL', false),
'freeipapi_ssl' => env('FREEIPAPI_SSL', true),
'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',
],
];
3 changes: 1 addition & 2 deletions src/GeoContentServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace NawrasBukhari\GeoContent;

use Illuminate\Support\Facades\Blade;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;

Expand All @@ -12,7 +11,7 @@ public function configurePackage(Package $package): void
{
$package
->name('geo-content')
->publishesServiceProvider(GeoContentServiceProvider::class)
->publishesServiceProvider(GeoContentServiceProvider::class);

$this->publishes([
__DIR__.'/../config/geo-content.php' => config_path('geo-content.php'),
Expand Down
4 changes: 2 additions & 2 deletions tests/GeoContentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
expect(GeoContent::onlyShowInCountryCode('US'))->toBe(true);
});

it('can not show in country', function () {
it('can not show in specific country', function () {
expect(GeoContent::doNotShowInCountry('United States of America'))->toBe(false);
});

it('can exclude continent code', function () {
expect(GeoContent::excludeContinentCode('AM'))->toBe(true);
});

it('can only show in continent', function () {
it('can only show in specific continent', function () {
expect(GeoContent::onlyShowInContinent('Americas'))->toBe(true);
});

0 comments on commit 1b8754a

Please sign in to comment.