Skip to content

[7.x] Avoid global app() when compiling components - #31868

Merged
taylorotwell merged 2 commits into
laravel:7.xfrom
QWp6t:patch-1
Mar 9, 2020
Merged

[7.x] Avoid global app() when compiling components#31868
taylorotwell merged 2 commits into
laravel:7.xfrom
QWp6t:patch-1

Conversation

@QWp6t

@QWp6t QWp6t commented Mar 9, 2020

Copy link
Copy Markdown
Contributor

The requirement of app() global function means that third-party consumption of illuminate/view will not be able to render components without reproducing an app() global.

Since $__env->getContainer() is guaranteed to be a Container contract, $__env->getContainer() should be able to be used as a drop-in replacement for app() in this scenario.

@taylorotwell
taylorotwell merged commit a85f932 into laravel:7.x Mar 9, 2020
@QWp6t
QWp6t deleted the patch-1 branch March 9, 2020 17:38
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