Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Once Laravel Package

spatie/once

A tiny PHP helper to run code only once per request. Cache expensive computations or object initialization in a single spot, keyed automatically by the call site. Great for computed properties, accessors, and avoiding duplicate work.

View on GitHub
Deep Wiki
Context7
3.1.2

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/once/compare/3.1.1...3.1.2

3.1.1

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/once/compare/3.1.0...3.1.1

3.1.0
3.0.2
3.0.1
  • fix for caching static functions of different classes with the same name (#62)
3.0.0
  • refactor to use a WeakMap
  • drop support for PHP 7
2.2.1
  • allow PHP 8
2.2.0
  • support global functions
2.1.3
  • differentiate between closures (#42)
2.1.2
  • remove excess parameter in get on cache
2.1.1
  • do not throw an error when using once in eval
2.1.0
  • add enabling/disable the cache
  • add flush method
  • drop support for PHP 7.1 and below
2.0.2
  • add ability to use once in static functions
2.0.1
  • improvements around serialization
2.0.0
  • ditch __memoized in favor of Spatie\Once\Cache
1.1.0
  • add MemoizeAwareTrait
1.0.1
  • fix cacheability of falsy return values
1.0.0
  • initial release
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/entity-migrator
codraw/doctrine-extra
codraw/aws-tool-kit
codraw/validator
codraw/workflow
codraw/open-api
codraw/cron-job
codraw/process
codraw/log
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony