Skip to content

Commit

Permalink
blank and filled now support stringable (#51300)
Browse files Browse the repository at this point in the history
* filled and blank works with `Stringable`

* unnecessary

---------

Co-authored-by: stefan.riedel <stefan.riedel@arbeitsmedizin.de>
  • Loading branch information
lava83 and stefan.riedel authored May 5, 2024
1 parent 8235189 commit 543b79f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions helpers.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ function blank($value)
return count($value) === 0;
}

if ($value instanceof Stringable) {
return $value->trim()->toString() === '';
}

return empty($value);
}
}
Expand Down

0 comments on commit 543b79f

Please sign in to comment.