phpgt/propfunc
A small PHP library that uses magic __get/__set methods to expose getters and setters as normal properties via the MagicProp trait, enabling live and read-only computed properties for DOM-style implementations. Note: PHP 8.4 property hooks may soon make it obsolete.
Internal Developer Productivity (DVP):
__propGetName/__propSetName hooks rather than scattering manual accessors across classes.Consistency & Maintainability:
__propGetName, __propSetName), which improves readability and makes code review easier.__get, __set). Teams that adopt it should do so knowingly rather than under the assumption it avoids magic methods.Gt\PropFunc namespace remains autoloadable, giving teams a low-risk migration path from v1.x to v2.x.Upgrade / Release Management:
SECURITY.md and refreshed CI (PHP 8.1+ target, Dependabot updates) signals active maintenance — a positive update versus the prior "last release in 2021" concern.Roadmap Prioritization:
Use Cases:
Gt\PropFunc autoload fallback allows incremental migration of existing models.Adopt if:
__get/__set hooks) as an explicit design choice — this package is fundamentally built on them.__propGetName/__propSetName convention from day one.Look elsewhere if:
$casts/$appends and see no boilerplate pain.Migration note (breaking change):
__prop_get_name → __propGetName, __prop_set_name → __propSetName.GT\PropFunc; the legacy Gt\PropFunc namespace still autoloads, so upgrades can be staged.For Executives: "This package reduces boilerplate for property access in our Laravel apps, cutting development time on CRUD-heavy features. Version 2.0 just shipped — it's a breaking change, but a small one: a one-time rename of property hooks and a PHP 8.1+ requirement (which we already meet or should adopt). Importantly, this release also adds a security policy and refreshes CI, which directly addresses the earlier concern that the project might be unmaintained. It's a low-risk, low-effort upgrade that keeps a productivity tool alive for the team."
For Engineering:
*"PropFunc v2.0.0 is a breaking release: hooks change from __prop_get_name/__prop_set_name to __propGetName/__propSetName, and the namespace is now GT\PropFunc (the old Gt\PropFunc namespace still autoloads, so we can migrate incrementally). PHP 8.1+ is now required. Note that the package is built on __get/__set magic methods — the earlier assessment framed it as avoiding them, which was inaccurate; we should adopt with that in mind.
SECURITY.md addition and active CI, maintenance risk is now materially lower than the previous assessment implied. I'd recommend a time-boxed spike on a single module, then a full rollout."*How can I help you explore Laravel packages today?