diff --git a/README.md b/README.md index 2e60fcb..e48291b 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,13 @@ Laravel 5.4 > You can install the package via composer: ```bash -composer require viitorcloud/laravel-ip-gateway +composer require vcian/laravel-ip-gateway ``` After installation, You need to publish the config file for this package. This will add the file `config/ip-gateway.php`, where you can configure this package. ```bash -php artisan vendor:publish --provider="LaravelIpGateway\IpGatewayProvider" +php artisan vendor:publish ``` ### Config Usage diff --git a/composer.json b/composer.json index 8c8096a..5bd6dd0 100644 --- a/composer.json +++ b/composer.json @@ -16,24 +16,23 @@ "license": "MIT", "authors": [ { - "name": "Rushikesh Soni", - "email": "rushikesh.soni@viitor.cloud", + "name": "Vcian - Viitorcloud", + "email": "administrator@viitorcloud.com", "role": "Creator" } ], "require": { - "laravel/framework": ">5.4", - "php": ">=5.4.0" + "php": "^8.0" }, "autoload": { "psr-4": { - "LaravelIpGateway\\": "src/" + "Vcian\\LaravelIpGateway\\": "src/" } }, "extra": { "laravel": { "providers": [ - "LaravelIpGateway\\IpGatewayProvider" + "Vcian\\LaravelIpGateway\\IpGatewayProvider" ] } }, diff --git a/publishable/config/ip-gateway.php b/publishable/config/ip-gateway.php index 1324722..e30187c 100644 --- a/publishable/config/ip-gateway.php +++ b/publishable/config/ip-gateway.php @@ -19,14 +19,14 @@ 'enable_blacklist' => true, /* - * Enable IP detection for middleware + * Enable IP detection for Middleware * - * You can use middleware name ('auth') + * You can use Middleware name like 'auth','web','api' * * @var array */ - 'middleware' => [ - + 'Middleware' => [ + 'web' // Default Middleware ], /* diff --git a/src/IpGatewayProvider.php b/src/IpGatewayProvider.php index 8d8d8aa..d443f12 100644 --- a/src/IpGatewayProvider.php +++ b/src/IpGatewayProvider.php @@ -1,9 +1,9 @@ app['router']; if (config('ip-gateway')) { - foreach (config('ip-gateway.middleware') as $middlewareName) { + foreach (config('ip-gateway.Middleware') as $middlewareName) { $router->pushMiddlewareToGroup($middlewareName, IpGatewayMiddleware::class); } } @@ -52,4 +52,4 @@ public function publishFiles() } } -} \ No newline at end of file +} diff --git a/src/middleware/IpGatewayMiddleware.php b/src/Middleware/IpGatewayMiddleware.php similarity index 97% rename from src/middleware/IpGatewayMiddleware.php rename to src/Middleware/IpGatewayMiddleware.php index 232f5fc..1f532c5 100644 --- a/src/middleware/IpGatewayMiddleware.php +++ b/src/Middleware/IpGatewayMiddleware.php @@ -1,6 +1,6 @@