spatie/macroable
Add methods to any class at runtime with Spatie’s Macroable trait. Register macros with closures or callables and call them like native methods; macros are bound to the class instance for access to $this. Inspired by Laravel’s Macroable implementation.
|
Package
|
Score
|
Description
|
Stars
|
Likes
|
Forks
|
Downloads
|
Issues
|
Score
|
Opportunity
|
License
|
Last Release
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| illuminate/macroable | 0.84 | Illuminate Macroable adds Laravel’s Macroable trait, letting you register custom methods (macros) on classes at runtime. Extend core components or your own objects without inheritance, enabling flexible, discoverable APIs and clean, centralized extension points. | 85 | 85 | 5 | 2M | 0 | 0.6 | 55.3 | MIT | — | |
| spatie/once | 0.82 | A tiny PHP helper to run code only once per request. Cache expensive computations or object initialization in a single spot, keyed automatically by the call site. Great for computed properties, accessors, and avoiding duplicate work. | 1,430 | 1,437 | 61 | 272K | 0 | 34.7 | 37.1 | MIT | 4 months ago | |
| aimeos/macro | 0.81 | aimeos/macro is a lightweight PHP macro/extension library that lets you add methods at runtime and extend objects and classes without inheritance. Handy for creating fluent APIs, plugin-style features, and flexible customization in Laravel or any PHP project. | 2,345 | 2,333 | 1 | 3K | 0 | 11.8 | 5.3 | MIT | — | |
| spatie/laravel-collection-macros | 0.78 | Adds a curated set of handy macros to Laravel Collections, extending them with extra helper methods (e.g., positional accessors like second/third, after, getNth, and more). Auto-registers via Composer for quick, drop-in productivity boosts. | 1,899 | 1,904 | 146 | 190K | 0 | 43.2 | 32.6 | NOASSERTION | 1 month ago |
How can I help you explore Laravel packages today?