Skip to content

[9.x] Make Application macroable#43966

Merged
taylorotwell merged 2 commits into
laravel:9.xfrom
ralphjsmit:make-application-macroable
Sep 1, 2022
Merged

[9.x] Make Application macroable#43966
taylorotwell merged 2 commits into
laravel:9.xfrom
ralphjsmit:make-application-macroable

Conversation

@ralphjsmit
Copy link
Copy Markdown
Contributor

This PR adds the macroable trait to the Application instance. This allows developers to add handy macros (e.g. environment) checks to the application instance.

For example:

App::macro('runningDuskTests', function () {
    return $this->environment('dusk');
});

Thanks!

@nunomaduro nunomaduro changed the title Make Application macroable [9.x] Make Application macroable Sep 1, 2022
@taylorotwell taylorotwell merged commit 1c1766f into laravel:9.x Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants