File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
framework/core/src/Foundation Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -96,8 +96,14 @@ protected function getAttributeNames()
96
96
{
97
97
$ cache = resolve (Cache::class);
98
98
99
- if ($ cache ->get (self ::$ CORE_VALIDATION_CACHE_KEY ) !== null ) {
100
- return $ cache ->get (self ::$ CORE_VALIDATION_CACHE_KEY );
99
+ $ cacheKey = sprintf (
100
+ 'core.validation.attributes.%s.%s ' ,
101
+ $ this ->translator ->getLocale (),
102
+ static ::class
103
+ );
104
+
105
+ if ($ cached = $ cache ->get ($ cacheKey )) {
106
+ return $ cached ;
101
107
}
102
108
103
109
$ extId = $ this ->getClassExtensionId ();
@@ -108,7 +114,7 @@ protected function getAttributeNames()
108
114
$ attributeNames [$ attribute ] = $ this ->translator ->trans ($ key );
109
115
}
110
116
111
- $ cache ->forever (self :: $ CORE_VALIDATION_CACHE_KEY , $ attributeNames );
117
+ $ cache ->forever ($ cacheKey , $ attributeNames );
112
118
113
119
return $ attributeNames ;
114
120
}
You can’t perform that action at this time.
0 commit comments