Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: allow default disk from forms config #222

Merged
merged 1 commit into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Curator.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ class Curator

protected int|Closure $maxSize = 5000;

protected string|Closure $diskName = 'public';
protected string|Closure|null $diskName = null;

protected string|Closure $directory = 'media';
protected string|Closure|null $directory = null;

protected bool $isLimitedToDirectory = false;

protected PathGenerator|string|null $pathGenerator = null;

protected string|Closure $visibility = 'public';
protected string|Closure|null $visibility = null;

protected array $cloudDisks = ['s3', 'cloudinary', 'imgix'];

Expand Down Expand Up @@ -394,7 +394,7 @@ public function getPathGenerator(): PathGenerator|string|null

public function getDirectory(): string
{
return $this->evaluate($this->directory);
return $this->evaluate($this->directory) ?? 'media';
}

public function isLimitedToDirectory(): bool
Expand All @@ -404,7 +404,7 @@ public function isLimitedToDirectory(): bool

public function getVisibility(): string
{
return $this->evaluate($this->visibility);
return $this->evaluate($this->visibility) ?? 'public';
}

public function getCloudDisks(): array
Expand Down
4 changes: 2 additions & 2 deletions src/Facades/Curator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
* @method static static maxWidth(int|Closure $width)
* @method static static minSize(int|Closure $size)
* @method static static maxSize(int|Closure $size)
* @method static static disk(string|Closure $disk)
* @method static static disk(string|Closure|null $disk)
* @method static static directory(Closure|string|null $directory)
* @method static static limitToDirectory(bool|Closure|null $condition = false)
* @method static static pathGenerator(PathGenerator|string|null $generator)
* @method static static visibility(string|Closure $visibility)
* @method static static visibility(string|Closure|null $visibility)
* @method static static cloudDisks(array $disks)
* @method static static imageCropAspectRatio(string|Closure|null $ratio)
* @method static static imageResizeTargetHeight(string|Closure|null $height)
Expand Down