Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Fix using container nesting to make the same 'abstract' in different context #51989

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

c-v-c-v
Copy link
Contributor

@c-v-c-v c-v-c-v commented Jul 2, 2024

Although this may not seem common, it is very covert for facade Log, as shown in the following code

class Service extends BaseService
{
    public function __construct(
        private readonly LoggerInterface $logger,
    ) {}
}

$this->app->when(Service::class)
            ->needs(LoggerInterface::class)
            ->give(function () {
                return Log::channel('test');
            });

The following examples in the documentation seem to be OK, probably without nested make. contextual-binding

@c-v-c-v c-v-c-v changed the title Fix using container nesting to make the same 'abstract' in different … Fix using container nesting to make the same 'abstract' in different context Jul 2, 2024
@driesvints driesvints changed the title Fix using container nesting to make the same 'abstract' in different context [11.x] Fix using container nesting to make the same 'abstract' in different context Jul 2, 2024
@taylorotwell taylorotwell merged commit 8d20a9c into laravel:11.x Jul 2, 2024
3 of 4 checks passed
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.

None yet

2 participants