Cache does not persist when used in macro's #65
philipboeken
started this conversation in
Bugs
Replies: 1 comment
-
I currently do not have the bandwidth to look into this, feel free to submit a PR with tests that fixes this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The cache does not persist within a single request when using once() in a macro function on the Laravel Eloquent Builder. For instance, if I register the following function in my Laravel application:
then it would be nice if the cache persist when repeatedly calling
User::getOnce()
for example. Currently this is not the case, and I think this is caused by the repeated binding of the macro callback to the Builder object (here or here). I'm not too sure however how this works exactly. Could this possibly be mitigated by retrieving the Cache via Laravel's service provider?Beta Was this translation helpful? Give feedback.
All reactions