Slugify cache prefix and quote it in the env

This commit is contained in:
Nabeel Shahzad
2021-04-10 21:13:34 -04:00
parent 2202c5b479
commit 498d5bfaf0
2 changed files with 3 additions and 2 deletions

View File

@@ -212,7 +212,8 @@ class ConfigService extends Service
protected function configCacheDriver($opts)
{
// Set the cache prefix
$opts['CACHE_PREFIX'] = uniqid($opts['SITE_NAME'].'_');
$prefix = substr(str_slug($opts['SITE_NAME'], '_'), 0, 8);
$opts['CACHE_PREFIX'] = strtolower(uniqid($prefix.'_'));
// Figure out what cache driver to initially use, depending on
// what is installed. It won't detect redis or anything, though

View File

@@ -34,7 +34,7 @@ DB_SOCKET=
# CACHE SETTINGS
CACHE_DRIVER=$CACHE_DRIVER$
CACHE_PREFIX=$CACHE_PREFIX$
CACHE_PREFIX='$CACHE_PREFIX$'
# EMAIL SETTINGS
# Look at the available mail configs in config/mail.php