-
Notifications
You must be signed in to change notification settings - Fork 230
feature/hash-cache-keys #53
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
Changes from 4 commits
f9c76f2
83690c5
1fcb964
bf5b2da
cec395f
d3ecb40
4cfba48
31e30c2
dbdaca5
d8bd679
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/vendor | ||
composer.lock | ||
.*.sw? | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ public static function all($columns = ['*']) | |
$class = get_called_class(); | ||
$instance = new $class; | ||
$tags = [str_slug(get_called_class())]; | ||
$key = 'genealabslaravelmodelcachingtestsfixturesauthor'; | ||
$key = sha1('genealabslaravelmodelcachingtestsfixturesauthor'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This won't work in a static function. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused as to why the function is marked static in the first place. It is called like an object method. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something like this? $key = $instance->makeCacheKey(); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for instance in |
||
|
||
return $instance->cache($tags) | ||
->rememberForever($key, function () use ($columns) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably best handled in your global git configuration. It's been considered "best practice" to leave out environment-specific ignores from the project's git-ignore.