Skip to content

Commit

Permalink
Handle null values correctly in Laravel 9
Browse files Browse the repository at this point in the history
  • Loading branch information
rawilk committed Feb 23, 2022
1 parent ca84a0d commit ad0d089
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Casts/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ class Password implements CastsInboundAttributes
{
public function set($model, string $key, $value, array $attributes)
{
if (is_null($value)) {
return null;
}

if (! Hash::needsRehash($value)) {
return $value;
}
Expand Down

0 comments on commit ad0d089

Please sign in to comment.