33use GeneaLabs \LaravelModelCaching \Traits \CachePrefixing ;
44use Illuminate \Database \Eloquent \Model ;
55use Illuminate \Database \Query \Builder ;
6+ use Illuminate \Support \Arr ;
67use Illuminate \Support \Collection ;
78use Illuminate \Database \Query \Expression ;
89use Illuminate \Database \Eloquent \Relations \HasMany ;
10+ use Illuminate \Support \Str ;
911
1012class CacheKey
1113{
@@ -62,13 +64,13 @@ protected function getLimitClause() : string
6264
6365 protected function getTableSlug () : string
6466 {
65- return str_slug ($ this ->model ->getTable ())
67+ return Str:: slug ($ this ->model ->getTable ())
6668 . ": " ;
6769 }
6870
6971 protected function getModelSlug () : string
7072 {
71- return str_slug (get_class ($ this ->model ));
73+ return Str:: slug (get_class ($ this ->model ));
7274 }
7375
7476 protected function getOffsetClause () : string
@@ -87,7 +89,7 @@ protected function getOrderByClauses() : string
8789 return $ orders
8890 ->reduce (function ($ carry , $ order ) {
8991 if (($ order ["type " ] ?? "" ) === "Raw " ) {
90- return $ carry . "_orderByRaw_ " . str_slug ($ order ["sql " ]);
92+ return $ carry . "_orderByRaw_ " . Str:: slug ($ order ["sql " ]);
9193 }
9294
9395 return $ carry . "_orderBy_ " . $ order ["column " ] . "_ " . $ order ["direction " ];
@@ -127,7 +129,7 @@ protected function getValuesClause(array $where = null) : string
127129
128130 protected function getValuesFromWhere (array $ where ) : string
129131 {
130- if (array_get ($ where , "query " )) {
132+ if (Arr:: get ($ where , "query " )) {
131133 $ prefix = $ this ->getCachePrefix ();
132134 $ subKey = (new self ($ this ->eagerLoad , $ this ->model , $ where ["query " ]))
133135 ->make ();
@@ -139,11 +141,11 @@ protected function getValuesFromWhere(array $where) : string
139141 return $ subKey ;
140142 }
141143
142- if (is_array (array_get ($ where , "values " ))) {
144+ if (is_array (Arr:: get ($ where , "values " ))) {
143145 return implode ("_ " , collect ($ where ["values " ])->flatten ()->toArray ());
144146 }
145147
146- return array_get ($ where , "value " , "" );
148+ return Arr:: get ($ where , "value " , "" );
147149 }
148150
149151 protected function getValuesFromBindings (array $ where , string $ values ) : string
0 commit comments