Skip to content

Instantly share code, notes, and snippets.

@rmcdaniel
Created November 15, 2022 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmcdaniel/a50d7367c329110fad913b9a7dc25369 to your computer and use it in GitHub Desktop.
Save rmcdaniel/a50d7367c329110fad913b9a7dc25369 to your computer and use it in GitHub Desktop.
<?php
namespace App\Workflows\InvalidateCache;
use Illuminate\Support\Facades\Http;
use Workflow\Activity;
class InvalidateCacheActivity extends Activity
{
public function execute($url)
{
Http::withHeaders([
'X-Client-key' => config('services.cloudimage.key'),
'Content-Type' => 'application/json'
])->post('https://api.cloudimage.com/invalidate', [
'scope' => 'original',
'urls' => [
'/' . $url
],
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment