What’s New in ThinkPHP 8.1? Detailed Feature and Fix List
ThinkPHP 8.1, slated for release in November, brings extensive improvements over 8.0—including routing enhancements, validation upgrades, multi‑module support, new middleware controls, expanded cache options, refined exception handling, and compatibility with PHP 8.4—providing developers with a more robust and flexible backend framework.
ThinkPHP 8.1 Update Details
ThinkPHP 8.1 is a major upcoming release (expected November) that addresses many shortcomings of version 8.0 and adds new capabilities while remaining compatible with PHP 8.4.
Fixed error when routing is defined using an array.
Improved validation scenario handling.
Routing groups now support default URL dispatching and binding, unaffected by forced routes.
Automatic URL dispatching supports multiple modules.
Resource routing now supports extended route definitions.
Multi‑module automatic routing rules added, with automatic execution of module middleware.
New when route variable validation method.
Added enumeration type validation.
Array validation now supports specifying keys and multi‑dimensional arrays.
Predefined route variable rules automatically cast integers or floats to the correct type.
Added action_bind_param configuration to set how action method parameters are bound.
System initialization phase now includes improved exception handling.
Configuration now includes getter functionality.
Optimized exception handling for JSON responses.
Environment variable file reading now supports shared environment files.
Validator now includes built‑in rules: accepted, acceptedIf, declined, declinedIf, multipleOf.
Cookie settings can now take effect within the current request.
Improved log backup filename rules.
Added withoutmiddleware method to exclude middleware from specific routes.
Optimized route dispatching.
Improved cache deserialization exception handling.
Validation exception class now provides getKey method to retrieve the error field name.
Enhanced default value determination for dependency‑injected objects.
Adjusted position of invokeAfter hook.
Request only method now supports forced type casting.
Optimized validation rule evaluation in the validator class.
Validator class can now use must attribute to enforce required fields regardless of defined require rules.
Cache configuration adds fail_delete option to force deletion when cache retrieval throws an exception.
Cache get method’s default parameter now accepts closures.
Cache pull method now includes default parameter handling.
Optimized smart event subscription for higher event response efficiency.
Added Macroable method injection capability.
Improved cache serialize / unserialize methods.
Full compatibility with PHP 8.4.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
