Skip to content
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

Use Eloquent Attributes to enable caching #186

Merged

Conversation

abenerd
Copy link
Contributor

@abenerd abenerd commented Jan 28, 2022

No description provided.

@christophrumpel
Copy link
Owner

Hey, thank you for the PR. Can you explain a little closer what the PR does?

@abenerd
Copy link
Contributor Author

abenerd commented Feb 4, 2022

I'm implementing laravel/framework#40022 which is the new way of creating custom attributes for models and as it is new it is therefore automatically better of course (\s)! What the way allows is that the calculated value is cached so that the next time it is accessed the cached value is returned. Before every time a custom attribute was accessed its value had to be calculated anew.

@christophrumpel
Copy link
Owner

Thanks, the caching part was new to me. 👍

@christophrumpel christophrumpel merged commit 693c2ca into christophrumpel:main Feb 5, 2022
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