Handle Laravel 13 `cache.serializable_classes` security hardening
masterLaravel 13 introduced cache.serializable_classes to block deserialization of arbitrary objects. Because Geocoder stores Collections of Address objects, caching may break if not configured correctly.
Default Behavior: This package automatically scans vendor/geocoder-php/* and merges those model classes into your application's cache.serializable_classes allow-list at boot.
Opting Out: If you want to manage the allow-list manually or disable this automatic behavior, set auto_register_serializable_classes to false in config/geocoder.php.
If you opt out, you must either:
- Manually add Geocoder model classes to
config/cache.php'sserializable_classesarray. - Disable caching entirely by calling
app('geocoder')->doNotCache()or settingcache.durationto0inconfig/geocoder.php.
// config/geocoder.php
'cache' => [
'auto_register_serializable_classes' => false,
],