configurable disks

This commit is contained in:
2024-08-23 20:58:45 +03:00
parent c43c29eb14
commit a737c2d571
5 changed files with 30 additions and 35 deletions
+12 -2
View File
@@ -25,8 +25,18 @@ final class Channel
)
{
$this->lucentUrl = $url . "/lucent";
$this->filesUrl = $url . "/storage";
$this->previewTargetUrl = $url . "/". $previewTarget;
$this->filesUrl = $this->makeFilesUrl();
$this->previewTargetUrl = $url . "/" . $previewTarget;
}
private function makeFilesUrl(): string
{
return match (config("filesystems.disks.lucent.driver")) {
"s3" => config("filesystems.disks.lucent.endpoint") . "/" . config("filesystems.disks.lucent.bucket"),
"local" => $this->url . "/storage" . config("filesystems.disks.lucent.endpoint"),
};
}
}
+2 -1
View File
@@ -3,6 +3,7 @@
namespace Lucent\Channel;
use Lucent\File\FileService;
use Lucent\Primitive\Collection;
use Lucent\Schema\Schema;
use Lucent\Schema\SchemaService;
@@ -13,7 +14,7 @@ final class ChannelService
public Channel $channel;
private function __construct(
public SchemaService $schemaService
public SchemaService $schemaService,
)
{