public function put($key, $value)
    {
        // if key exits then override
        if ($this::has($key)) {
            $setting = (new SettingModel)
                ->cached()
                ->where('key', $key)
                ->first();

            $setting->value = $value;

            return $setting->save();
        }

        return SettingModel::create([
            'key' => $key,
            'value' => $value,
        ]);
    }
public function put($key, $value)
    {
        // if key exits then override
        if ($this::has($key)) {
            $setting = (new SettingModel)
                ->cached()
                ->where('key', $key)
                ->first();

            $setting->value = $value;

            return $setting->save();
        }

        return SettingModel::create([
            'key' => $key,
            'value' => $value,
        ]);
    }
public function put ( $ key , $ value ) { // if key exits then override if ( $ this :: has ( $ key ) ) { $ setting = ( new SettingModel ) -> cached ( ) -> where ( 'key' , $ key ) -> first ( ) ; $ setting -> value = $ value ; return $ setting -> save ( ) ; } return SettingModel :: create ( [ 'key' => $ key , 'value' => $ value , ] ) ; }
Store new key and value in settings if it's already
exits then override.

@param  string $key
@param  string $value
@return null
Store new key and value in settings if it s already exits then override .