админка

This commit is contained in:
2026-03-13 23:33:35 +04:00
parent bae063a4fa
commit eaedeeb52b
41 changed files with 2506 additions and 67 deletions
@@ -0,0 +1,36 @@
<?php
namespace App\Services;
use Illuminate\Support\Facades\Storage;
use Throwable;
class GameClientDownloadService
{
public function filename(): string
{
return basename($this->objectKey());
}
public function temporaryUrl(): string
{
$disk = Storage::disk(config('moonwell.client.disk'));
$objectKey = $this->objectKey();
$filename = $this->filename();
try {
return $disk->temporaryUrl(
$objectKey,
now()->addMinutes(config('moonwell.client.temporary_url_minutes')),
['ResponseContentDisposition' => sprintf('attachment; filename="%s"', $filename)],
);
} catch (Throwable) {
return $disk->url($objectKey);
}
}
private function objectKey(): string
{
return (string) config('moonwell.client.object_key');
}
}