Skip to content

Commit

Permalink
Merge pull request #407 from awcodes/fix/max-items-valiation
Browse files Browse the repository at this point in the history
Fix: max items validation error in panel
  • Loading branch information
awcodes authored Jan 4, 2024
2 parents 8ee33f1 + 74177fa commit fa045a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Components/Modals/CuratorPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Livewire\Attributes\On;
use Livewire\Component;
use Livewire\WithPagination;
Expand Down Expand Up @@ -138,6 +139,12 @@ public function openModal(string $id, array $settings = []): void

public function form(Form $form): Form
{
if ($this->maxItems) {
$this->validationRules = array_filter($this->validationRules, function ($value) {
if ($value === 'array' || str_starts_with($value, 'max:')) { return false; }
});
}

return $form
->schema([
Uploader::make('files_to_add')
Expand Down

0 comments on commit fa045a8

Please sign in to comment.