Skip to content

Is there a solution to the issue of Laravel-Settings cache where multiple tenants cannot be distinguished? #343

@Wsmallnews

Description

@Wsmallnews

Each tenant uses a separate database, while the laravel-settings cache shares a single Redis instance
Or
Tenants share a common database, differentiated by team_id, such as the filamentphp framework (I have already implemented tenant settings through a custom repository)

However, I am currently facing an issue where the laravel-settings cache key remains the same across multiple tenants, rendering the cache indistinguishable between them

I found some older issues, but I haven't found a solution to this problem. Is there a solution to this problem now? Thank you very much for your answer
#39
#139

If this issue remains unresolved, I will attempt to submit a pull request (PR):

There will be a problem with this method: because tenants are typically handled in the middleware, if a setting class is used in the boot method of serviceProvider, the correct tenant cannot be obtained

  • Add a static method resolveCacheKey to the invoked settings object, and then use this method to change the cache key

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions