Skip to content

Commit

Permalink
[11.x] Stringable is also an interface of symfony (#51309)
Browse files Browse the repository at this point in the history
* filled and blank works with `Stringable`

* unnecessary

* `Stringable` is also an interface from symfony and is implemented on models. So if we check a model if a model is filled it except an error: Call to undefined method App\\Model::trim(). So we use now explicit Illuminate\Support\Stringable

* reduce compare to native trim - function

* unnused Model

---------

Co-authored-by: stefan.riedel <stefan.riedel@arbeitsmedizin.de>
  • Loading branch information
lava83 and stefan.riedel authored May 6, 2024
1 parent 580ffe1 commit c9d2ba0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Support/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function blank($value)
}

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

return empty($value);
Expand Down

0 comments on commit c9d2ba0

Please sign in to comment.