Skip to content

Force resolvers cache invalidation to central context #1340

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

Open
darkons opened this issue Mar 31, 2025 · 0 comments
Open

Force resolvers cache invalidation to central context #1340

darkons opened this issue Mar 31, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@darkons
Copy link

darkons commented Mar 31, 2025

Bug description

The tenancy cache is not invalidated when the tenant is updated from tenant context due to the CacheTenancyBootstrapper.

Maybe it would be a good idea to force the use of the central cache in the invalidateResolverCache method of the Tenancy class.

Steps to reproduce

Update the current Tenant model from some tenant context controller:

class SomeTenantContextController extends Controller
{
    public function update(Request $request): RedirectResponse
    {
        tenant()->update([
            'map_center_lat' => $request->map_center_lat,
            'map_center_lng' => $request->map_center_lng,
        ]);
    }
}

Of course, using the tenancy()->central() helper method works correctly because CacheTenancyBootstrapper is reverted.

Expected behavior

The Tenant cache should be invalidated.

Laravel version

12.0.3

stancl/tenancy version

4.x commit 8cd15db

@darkons darkons added the bug Something isn't working label Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants