Some Laravel macros I have found useful and will probably put in a package someday.
The code in this gist is provided under the MIT license (see LICENSE.md).
For proper type hinting (without IDE plugins), add /** @var MacroableClass $this */ before any usage of $this, like so:
MacroableClass::macro("name", function (string $arg = "bar") {