Skip to content

Commit b36602b

Browse files
committed
Don’t bypass null values
1 parent 36c982e commit b36602b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,14 +471,14 @@ protected function mutateAttributeForArray($key, $value)
471471
*/
472472
protected function castAttribute($key, $value)
473473
{
474-
if (is_null($value)) {
475-
return $value;
476-
}
477-
478474
if ($this->isClassCastable($key)) {
479475
return $this->castToClass($key);
480476
}
481477

478+
if (is_null($value)) {
479+
return $value;
480+
}
481+
482482
switch ($this->getCastType($key)) {
483483
case 'int':
484484
case 'integer':

0 commit comments

Comments
 (0)