generated from vormkracht10/laravel-package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73813fa
commit 136dec9
Showing
16 changed files
with
90 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
<?php | ||
|
||
// config for Vormkracht10/LaravelTrustedProxiesCloudflare | ||
return [ | ||
'enabled' => (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', | ||
], | ||
]; |
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
database/migrations/create_trusted_proxies_cloudflare_table.php.stub
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Vormkracht10\TrustedProxiesCloudflare\Actions; | ||
|
||
class GetCloudflareIPs | ||
{ | ||
public function __invoke() | ||
{ | ||
$ipv4 = explode(PHP_EOL, trim(file_get_contents(config('trusted-proxies-cloudflare.api.ipv4'))); | ||
$ipv6 = explode(PHP_EOL, trim(file_get_contents(config('trusted-proxies-cloudflare.api.ipv4'))); | ||
|
||
return $ipv4 + $ipv6; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Vormkracht10\TrustedProxiesCloudflare\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Vormkracht10\TrustedProxiesCloudflare\Actions\GetCloudflareIPs; | ||
|
||
class CacheCloudflareProxies extends Command | ||
{ | ||
public $signature = 'cloudflare:cache-trusted-proxies'; | ||
|
||
public $description = ''; | ||
|
||
public function handle(): int | ||
{ | ||
$ips = (new GetCloudflareIPs)(); | ||
|
||
dd($ips); | ||
|
||
$this->comment('All done'); | ||
|
||
return self::SUCCESS; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Vormkracht10\TrustedProxiesCloudflare\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
/** | ||
* @see \Vormkracht10\TrustedProxiesCloudflare\TrustedProxiesCloudflare | ||
*/ | ||
class TrustedProxiesCloudflare extends Facade | ||
{ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return \Vormkracht10\TrustedProxiesCloudflare\TrustedProxiesCloudflare::class; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Vormkracht10\TrustedProxiesCloudflare; | ||
|
||
class TrustedProxiesCloudflare | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?php | ||
|
||
use Vormkracht10\LaravelTrustedProxiesCloudflare\Tests\TestCase; | ||
use Vormkracht10\TrustedProxiesCloudflare\Tests\TestCase; | ||
|
||
uses(TestCase::class)->in(__DIR__); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters