Closed timacdonald closed 10 months ago
fixes https://github.com/laravel/pennant/issues/82
The cache is currently holding onto scope object, which is a potential memory issue as all scope will now stay in memory until the end of the request.
It also means that the cache behaves unexpectedly for eloquent models when different instances of the same record are used, e.g.,
Feature::for(User::find(123))->activate('foo'); Feature::for(User::find(123))->activate('foo');
This fixes the memory issue and model reference issues by making sure the scope is serialized before it enters the cache.
fixes https://github.com/laravel/pennant/issues/82
The cache is currently holding onto scope object, which is a potential memory issue as all scope will now stay in memory until the end of the request.
It also means that the cache behaves unexpectedly for eloquent models when different instances of the same record are used, e.g.,
This fixes the memory issue and model reference issues by making sure the scope is serialized before it enters the cache.