diff --git a/README.md b/README.md index 3bbe3f5..236f2d7 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,8 @@ php artisan vendor:publish --tag="laravel-trusted-proxies-cloudflare-views" ## Usage ```php -$laravelTrustedProxiesCloudflare = new Vormkracht10\LaravelTrustedProxiesCloudflare(); -echo $laravelTrustedProxiesCloudflare->echoPhrase('Hello, Vormkracht10!'); +$TrustedProxiesCloudflare = new Vormkracht10\TrustedProxiesCloudflare(); +echo $TrustedProxiesCloudflare->echoPhrase('Hello, Vormkracht10!'); ``` ## Testing @@ -68,8 +68,8 @@ Please review [our security policy](../../security/policy) on how to report secu ## Credits -- [Mark van Eijk](https://github.com/markvaneijk) -- [All Contributors](../../contributors) +- [Mark van Eijk](https://github.com/markvaneijk) +- [All Contributors](../../contributors) ## License diff --git a/composer.json b/composer.json index b962f3c..53f333c 100644 --- a/composer.json +++ b/composer.json @@ -34,13 +34,13 @@ }, "autoload": { "psr-4": { - "Vormkracht10\\LaravelTrustedProxiesCloudflare\\": "src/", - "Vormkracht10\\LaravelTrustedProxiesCloudflare\\Database\\Factories\\": "database/factories/" + "Vormkracht10\\TrustedProxiesCloudflare\\": "src/", + "Vormkracht10\\TrustedProxiesCloudflare\\Database\\Factories\\": "database/factories/" } }, "autoload-dev": { "psr-4": { - "Vormkracht10\\LaravelTrustedProxiesCloudflare\\Tests\\": "tests/" + "Vormkracht10\\TrustedProxiesCloudflare\\Tests\\": "tests/" } }, "scripts": { @@ -60,13 +60,13 @@ "extra": { "laravel": { "providers": [ - "Vormkracht10\\LaravelTrustedProxiesCloudflare\\LaravelTrustedProxiesCloudflareServiceProvider" + "Vormkracht10\\TrustedProxiesCloudflare\\TrustedProxiesCloudflareServiceProvider" ], "aliases": { - "LaravelTrustedProxiesCloudflare": "Vormkracht10\\LaravelTrustedProxiesCloudflare\\Facades\\LaravelTrustedProxiesCloudflare" + "TrustedProxiesCloudflare": "Vormkracht10\\TrustedProxiesCloudflare\\Facades\\TrustedProxiesCloudflare" } } }, "minimum-stability": "dev", "prefer-stable": true -} \ No newline at end of file +} diff --git a/config/trusted-proxies-cloudflare.php b/config/trusted-proxies-cloudflare.php index 30053a0..0b998bc 100644 --- a/config/trusted-proxies-cloudflare.php +++ b/config/trusted-proxies-cloudflare.php @@ -1,6 +1,15 @@ (bool) env('TRUSTED_PROXIES_CLOUDFLARE_ENABLED', false), + 'cache' => [ + 'key' => env('TRUSTED_PROXIES_CLOUDFLARE_CACHE_KEY', 'trusted-proxies-cloudflare'), + 'store' => env('TRUSTED_PROXIES_CLOUDFLARE_CACHE_STORE', 'file'), + ], + + 'api' => [ + 'ipv4' => 'https://www.cloudflare.com/ips-v4', + 'ipv6' => 'https://www.cloudflare.com/ips-v6', + ], ]; diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php deleted file mode 100644 index 9f67eaa..0000000 --- a/database/factories/ModelFactory.php +++ /dev/null @@ -1,19 +0,0 @@ -id(); - - // add fields - - $table->timestamps(); - }); - } -}; diff --git a/resources/views/.gitkeep b/resources/views/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/Actions/GetCloudflareIPs.php b/src/Actions/GetCloudflareIPs.php new file mode 100644 index 0000000..7eeab6c --- /dev/null +++ b/src/Actions/GetCloudflareIPs.php @@ -0,0 +1,14 @@ +comment('All done'); + + return self::SUCCESS; + } +} diff --git a/src/Commands/LaravelTrustedProxiesCloudflareCommand.php b/src/Commands/LaravelTrustedProxiesCloudflareCommand.php deleted file mode 100644 index 9fe6685..0000000 --- a/src/Commands/LaravelTrustedProxiesCloudflareCommand.php +++ /dev/null @@ -1,19 +0,0 @@ -comment('All done'); - - return self::SUCCESS; - } -} diff --git a/src/Facades/LaravelTrustedProxiesCloudflare.php b/src/Facades/LaravelTrustedProxiesCloudflare.php deleted file mode 100644 index c23dcfb..0000000 --- a/src/Facades/LaravelTrustedProxiesCloudflare.php +++ /dev/null @@ -1,16 +0,0 @@ -name('laravel-trusted-proxies-cloudflare') ->hasConfigFile() - ->hasViews() - ->hasMigration('create_laravel-trusted-proxies-cloudflare_table') - ->hasCommand(LaravelTrustedProxiesCloudflareCommand::class); + ->hasCommand(CacheCloudflareProxies::class); } } diff --git a/tests/Pest.php b/tests/Pest.php index 682e87b..3da9d38 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -1,5 +1,5 @@ in(__DIR__); diff --git a/tests/TestCase.php b/tests/TestCase.php index 6eff11e..f4a26e6 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,10 +1,10 @@ 'Vormkracht10\\LaravelTrustedProxiesCloudflare\\Database\\Factories\\'.class_basename($modelName).'Factory' + fn (string $modelName) => 'Vormkracht10\\TrustedProxiesCloudflare\\Database\\Factories\\'.class_basename($modelName).'Factory' ); } protected function getPackageProviders($app) { return [ - LaravelTrustedProxiesCloudflareServiceProvider::class, + TrustedProxiesCloudflareServiceProvider::class, ]; }