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: Undefined $maxParallelUploads Variable in v3.2.1.33 by Moving Logic to FileUpload Class #15375

Closed
wants to merge 2 commits into from
Closed
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
14 changes: 0 additions & 14 deletions packages/forms/src/Components/BaseFileUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class BaseFileUpload extends Field implements Contracts\HasNestedRecursiveValida

protected int | Closure | null $minSize = null;

protected int | Closure | null $maxParallelUploads = null;

protected int | Closure | null $maxFiles = null;

protected int | Closure | null $minFiles = null;
Expand Down Expand Up @@ -395,13 +393,6 @@ public function minSize(int | Closure | null $size): static
return $this;
}

public function maxParallelUploads(int | Closure | null $count): static
{
$this->maxParallelUploads = $count;

return $this;
}

public function maxFiles(int | Closure | null $count): static
{
$this->maxFiles = $count;
Expand Down Expand Up @@ -549,11 +540,6 @@ public function getMinSize(): ?int
return $this->evaluate($this->minSize);
}

public function getMaxParallelUploads(): ?int
{
return $this->evaluate($this->maxParallelUploads);
}

public function getVisibility(): string
{
return $this->evaluate($this->visibility);
Expand Down
14 changes: 14 additions & 0 deletions packages/forms/src/Components/FileUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class FileUpload extends BaseFileUpload
*/
protected string $view = 'filament-forms::components.file-upload';

protected int | Closure | null $maxParallelUploads = null;

protected string | Closure | null $imageCropAspectRatio = null;

protected string | Closure | null $imagePreviewHeight = null;
Expand Down Expand Up @@ -228,6 +230,18 @@ public function uploadProgressIndicatorPosition(string | Closure | null $positio
return $this;
}

public function maxParallelUploads(int | Closure | null $count): static
{
$this->maxParallelUploads = $count;

return $this;
}

public function getMaxParallelUploads(): ?int
{
return $this->evaluate($this->maxParallelUploads);
}

public function getImageCropAspectRatio(): ?string
{
return $this->evaluate($this->imageCropAspectRatio);
Expand Down
Loading