In my current app, I'm trying to use a nullable DateTime field but since it's getting casted, I'm getting a Carbon instance back (aka now()) which is a problem.
The problem is Settings::getValueAttribute which is casting null values.
The default laravel behavior, which this package seems like it's trying to emulate, doesn't do this for a bunch of cast types (see \Illuminate\Database\Eloquent\Concerns\HasAttributes::$primitiveCastTypes and \Illuminate\Database\Eloquent\Concerns\HasAttributes::castAttribute).
In my current app, I'm trying to use a nullable DateTime field but since it's getting casted, I'm getting a Carbon instance back (aka
now()
) which is a problem.The problem is
Settings::getValueAttribute
which is casting null values. The default laravel behavior, which this package seems like it's trying to emulate, doesn't do this for a bunch of cast types (see\Illuminate\Database\Eloquent\Concerns\HasAttributes::$primitiveCastTypes
and\Illuminate\Database\Eloquent\Concerns\HasAttributes::castAttribute
).I'll submit a PR