Skip to content

Commit

Permalink
Merge pull request #222 from awcodes/fix/default-disk-directory-etc
Browse files Browse the repository at this point in the history
Fix: allow default disk from forms config
  • Loading branch information
awcodes authored Jun 30, 2023
2 parents 8d674ea + 2c55bbe commit 6fc4165
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit 6fc4165

Please sign in to comment.