storage and image model
This commit is contained in:
@@ -4,12 +4,14 @@ namespace Lucent\Channel;
|
||||
|
||||
use Lucent\Channel\Data\UserCommand;
|
||||
use Lucent\Primitive\Collection;
|
||||
use Lucent\Schema\FilesSchema;
|
||||
use Lucent\Schema\Schema;
|
||||
|
||||
final class Channel
|
||||
{
|
||||
public string $lucentUrl;
|
||||
public string $filesUrl;
|
||||
public array $disks;
|
||||
public string $previewTargetUrl;
|
||||
|
||||
/**
|
||||
@@ -28,6 +30,7 @@ final class Channel
|
||||
{
|
||||
$this->lucentUrl = $url . "/lucent";
|
||||
$this->filesUrl = $this->makeFilesUrl();
|
||||
$this->disks = $this->getDisksFromSchemas();
|
||||
$this->previewTargetUrl = $url . "/" . $previewTarget;
|
||||
}
|
||||
|
||||
@@ -42,4 +45,11 @@ final class Channel
|
||||
|
||||
}
|
||||
|
||||
private function getDisksFromSchemas()
|
||||
{
|
||||
return $this->schemas->filter(fn(Schema $schema) => get_class($schema) === FilesSchema::class)->reduce(function (array $carry, Schema $schema) {
|
||||
$carry[$schema->disk] = config("filesystems.disks." . $schema->disk . ".url");
|
||||
return $carry;
|
||||
}, []);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user