Skip to content

[6.x] Add serializable classes to allowlist#14416

Merged
jasonvarga merged 8 commits into6.xfrom
serializable-classes
Apr 2, 2026
Merged

[6.x] Add serializable classes to allowlist#14416
jasonvarga merged 8 commits into6.xfrom
serializable-classes

Conversation

@duncanmcclean
Copy link
Copy Markdown
Member

@duncanmcclean duncanmcclean commented Apr 1, 2026

Laravel recently introduced the serializable_classes config to limit which classes with __destruct, __wakeup methods can be deserialised.

This option is false in new Laravel 13 applications, meaning you'll see an error when Statamic attempts to retrieve objects from the cache:

The script tried to call a method on an incomplete object. Please ensure that the class definition "Illuminate\Support\Collection" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition

This PR fixes it by adding specific classes from Statamic to the allowlist, preventing the error.

Related: laravel/framework#58911

@jasonvarga jasonvarga merged commit a33919e into 6.x Apr 2, 2026
17 checks passed
@jasonvarga jasonvarga deleted the serializable-classes branch April 2, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants