plank / laravel-metable

A package for handling arbitrary data in Laravel 5 applications
MIT License
281 stars 42 forks source link

Ensure that `getAllMeta` will not throw exception in case we haven't set `defaultMetaValues` property #92

Closed GeoSot closed 1 year ago

GeoSot commented 1 year ago

Using Laravel 9 strict mode Model::shouldBeStrict(), I got the following exception, as model tries to access a not existent attribute.

image

Just adding a Null coalescing (??) with an array fallback, is working fleshly

coveralls commented 1 year ago

Coverage Status

Coverage remained the same at 98.667% when pulling db7b59948287e93dd7b1efdb2891340407ed1a2a on GeoSot:add_default_values_on-get_all_meta into b531c73e62346288d7f3ba4ddfc2ee16c51e7525 on plank:master.