Skip to content

Conversation

@jnoordsij
Copy link
Contributor

@jnoordsij jnoordsij commented Dec 10, 2025

If one currently wants to clear the resolved instance for a Facade class, there are two possibilities:

  • Find out (through the implementing code) what the value of getFacadeAccessor for the particular class is, then pass this to Facade::clearResolvedInstance
  • Clear all instances with clearResolvedInstances

Given the first is somewhat cumbersome and the second a bit too much of a shotgun approach for some usecases, this PR propose to rework the clearResolvedInstance instance method in such a way that it allows calling it without any arguments, defaulting to the value obtained from getFacadeAccessor. This allows one to simply call ChildFacade::clearResolvedInstance() without requiring any knowledge about the underlying accessor implementation.

For 'stylistic' reasons, I've opted to change relevant calls to:

  • Facade::clearResolvedInstances to signify all instances will be cleared, regardless of class
  • ChildFacade::clearResolvedInstance to signify which particular instance will be cleared

@jnoordsij jnoordsij force-pushed the facade-clearresolved-call branch from 2c30227 to 2bd9e5e Compare December 10, 2025 17:06
@taylorotwell taylorotwell merged commit 7a55d3e into laravel:12.x Dec 10, 2025
70 checks passed
@jnoordsij jnoordsij deleted the facade-clearresolved-call branch December 10, 2025 19:58
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