Skip to content

Commit

Permalink
Merge pull request #10 from kirschbaum-development/dev
Browse files Browse the repository at this point in the history
Fix edge case with re-hydrating filters from Livewire
  • Loading branch information
dvanscott authored Jul 18, 2022
2 parents a91d6d0 + 4585cbd commit 706ad4c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.2.1
uses: dependabot/fetch-metadata@v1.3.3
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 1 addition & 1 deletion src/FilterCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function toLivewire(): array
public static function fromLivewire($value): self
{
$filters = collect($value)
->flatMap(fn ($values, $key) => [$key => new Filter(...$values)])
->flatMap(fn ($values, $key) => [$key => $values instanceof Filter ? $values : new Filter(...$values)])
->all();

return new static($filters);
Expand Down

0 comments on commit 706ad4c

Please sign in to comment.