You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When having Model::preventAccessingMissingAttributes() active in theAppServiceProvider.php and there's a model with a cast (in our case boolean) it will not throw an exception when accessing the attribute if it isn't loaded.
When removing the cast it does throw an exception.
Steps To Reproduce
class Test extends Model
{
protected$fillable = [
'some_boolean',
];
protected$casts = [
'some_boolean' => 'boolean',
];
}
Test::create(['some_boolean' => true]);
$test = Test::select('id')->first();
$test->some_boolean; (null)