← All talks

Laravel Macros

Laravel's Macroable trait is a quiet superpower. A tour of what you can extend, how it differs from inheritance, and a handful of small macros that have earned their keep in production.

11 slides

Contents

  1. 01::macro(...$args)
  2. 02What Are Macros?
  3. 03Why Use Macros?
  4. 04Avoiding Collisions in Packages
  5. 05Resolving a Collision
  6. 06Where to Register Macros
  7. 07Example: Extending Auth
  8. 08Macros in Tests
  9. 09Composing Macros
  10. 10When Not to Use Macros
  11. 11Key Takeaways