Skip to content

Commit ad0d089

Browse files
committed
Handle null values correctly in Laravel 9
1 parent ca84a0d commit ad0d089

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Casts/Password.php

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ class Password implements CastsInboundAttributes
1111
{
1212
public function set($model, string $key, $value, array $attributes)
1313
{
14+
if (is_null($value)) {
15+
return null;
16+
}
17+
1418
if (! Hash::needsRehash($value)) {
1519
return $value;
1620
}

0 commit comments

Comments
 (0)