fix: service templates

This commit is contained in:
Andras Bacsai
2023-09-28 22:20:49 +02:00
parent 91e1eb7664
commit 38a22dcf4d
4 changed files with 25 additions and 28 deletions

View File

@@ -48,15 +48,15 @@ class SyncBunny extends Command
$versions = "versions.json";
PendingRequest::macro('storage', function ($fileName) use($that) {
PendingRequest::macro('storage', function ($file) use($that) {
$headers = [
'AccessKey' => env('BUNNY_STORAGE_API_KEY'),
'Accept' => 'application/json',
'Content-Type' => 'application/octet-stream'
];
$fileStream = fopen($fileName, "r");
$file = fread($fileStream, filesize($fileName));
$that->info('Uploading: ' . $fileName);
$fileStream = fopen($file, "r");
$file = fread($fileStream, filesize($file));
$that->info('Uploading: ' . $file);
return PendingRequest::baseUrl('https://storage.bunnycdn.com')->withHeaders($headers)->withBody($file)->throw();
});
PendingRequest::macro('purge', function ($url) use ($that) {