diff --git a/src/Commands/CloudflarePurge.php b/src/Commands/CloudflarePurge.php new file mode 100644 index 0000000..150d5d0 --- /dev/null +++ b/src/Commands/CloudflarePurge.php @@ -0,0 +1,43 @@ +argument('zone').'/purge_cache', [ + 'purge_everything' => true, + ], [ + 'X-Auth-Email' => $this->argument('email'), + 'X-Auth-Key' => $this->argument('key'), + 'Content-Type' => 'application/json', + ]); + + $this->info('Purged.'); + + return 0; + } +} diff --git a/src/SupportProvider.php b/src/SupportProvider.php index b470290..78f9e89 100644 --- a/src/SupportProvider.php +++ b/src/SupportProvider.php @@ -5,6 +5,7 @@ use Illuminate\Support\Facades\Blade; use Illuminate\Support\Facades\Request; use Illuminate\Support\ServiceProvider; +use Grafite\Support\Commands\CloudflarePurge; class SupportProvider extends ServiceProvider { @@ -50,6 +51,8 @@ public function boot() */ public function register() { - // + $this->commands([ + CloudflarePurge::class, + ]); } }