format settings key

This commit is contained in:
Nabeel Shahzad
2017-12-31 11:19:18 -06:00
parent 948338d2b6
commit e73440d081
2 changed files with 9 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ class SettingRepository extends BaseRepository implements CacheableInterface
*/
public function retrieve($key)
{
$key = str_replace('.', '_', strtolower($key));
$key = Setting::formatKey($key);
$setting = $this->findWhere(['id' => $key], ['type', 'value'])->first();
if(!$setting) {
@@ -66,7 +66,8 @@ class SettingRepository extends BaseRepository implements CacheableInterface
*/
public function store($key, $value)
{
$setting = $this->findWhere(['key' => $key], ['id'])->first();
$key = Setting::formatKey($key);
$setting = $this->findWhere(['id' => $key], ['id'])->first();
if (!$setting) {
return null;
}