laravel-registry
laravel-registry copied to clipboard
Allow manual cache refresh or direct database retrieval
Since Registry::setCache() is only called on Registry::__construct(), any non-reloading instance of the app (i.e. php artisan tinker or php artisan queue:work --daemon) will not see changes made to the registry by another app instance (i.e. a web interface) after they are loaded. Tinker is not that big of a deal, but for production sites the queue daemon is. It would be nice to allow for a way to either refresh the cache or bypass it and retrieve directly from the database.
a) A simple solution would be to either make Registry::setCache() public or to provide another public method that calls it.
b) A perhaps prettier solution would be to have an optional boolean third parameter to Registry::get() to allow for non-cached calls.
What do you think? If you pick one of the above, I could probably submit a PR, but I didn't want to proceed my own way without your thoughts.