Add InteractsWithData trait and enhance Fluent class by huangdijia · Pull Request #7476 · hyperf/hyperf

added 4 commits

August 2, 2025 17:53
Introduces the InteractsWithData trait to provide advanced data interaction methods. Updates the Fluent class to use this trait and adds new methods for attribute access, mutation, and data retrieval. Also adds the enum_value helper to Functions.php for handling enum values.
This commit adds new test cases for the Fluent class, covering methods such as getIterator, set, fill, value, scope, all, data interaction methods, conditional methods (whenHas, whenFilled, whenMissing), date parsing, and enum handling. These tests improve coverage and ensure correct behavior for a wide range of Fluent features.
Replaced fully qualified class names with imported classes for ArrayIterator, Carbon, Collection, and Stringable in assertions. Also standardized array formatting by adding trailing commas for consistency and readability.
Documented the addition of the `InteractsWithData` trait and enhancements to the `Fluent` class in the changelog for version 3.1.61.

@limingxinleo

@limingxinleo

limingxinleo

limingxinleo