public function forget($key)
    {
        $keyExp = explode('.', $key);

        // get settings value by first key name
        $query = $this->database
            ->table($this->config['db_table'])
            ->where('setting_key', $keyExp[0]);

        $row = $query->first(['setting_value']);

        if ( ! is_null($row))
        {
            if (count($keyExp) > 1)
            {
                // if found more keys, then forget last key from array
                $setting_value = json_decode($row->setting_value, true);

                unset($keyExp[0]);
                $newKey = implode('.', $keyExp);

                Arr::forget($setting_value, $newKey);


                if (count($setting_value) > 0)
                {
                    // if we still have settings, update settings row
                    $query->update(['setting_value' => json_encode($setting_value)]);
                }
                else
                {
                    // if settings value remain blank, delete settings row
                    $query->delete();
                }
            }
            else
            {
                // if found only one key, delete settings row
                $query->delete();
            }
        }

        $this->cache->forget($key);
    }
public function forget($key)
    {
        $keyExp = explode('.', $key);

        // get settings value by first key name
        $query = $this->database
            ->table($this->config['db_table'])
            ->where('setting_key', $keyExp[0]);

        $row = $query->first(['setting_value']);

        if ( ! is_null($row))
        {
            if (count($keyExp) > 1)
            {
                // if found more keys, then forget last key from array
                $setting_value = json_decode($row->setting_value, true);

                unset($keyExp[0]);
                $newKey = implode('.', $keyExp);

                Arr::forget($setting_value, $newKey);


                if (count($setting_value) > 0)
                {
                    // if we still have settings, update settings row
                    $query->update(['setting_value' => json_encode($setting_value)]);
                }
                else
                {
                    // if settings value remain blank, delete settings row
                    $query->delete();
                }
            }
            else
            {
                // if found only one key, delete settings row
                $query->delete();
            }
        }

        $this->cache->forget($key);
    }
public function forget ( $ key ) { $ keyExp = explode ( '.' , $ key ) ; // get settings value by first key name $ query = $ this -> database -> table ( $ this -> config [ 'db_table' ] ) -> where ( 'setting_key' , $ keyExp [ 0 ] ) ; $ row = $ query -> first ( [ 'setting_value' ] ) ; if ( ! is_null ( $ row ) ) { if ( count ( $ keyExp ) > 1 ) { // if found more keys, then forget last key from array $ setting_value = json_decode ( $ row -> setting_value , true ) ; unset ( $ keyExp [ 0 ] ) ; $ newKey = implode ( '.' , $ keyExp ) ; Arr :: forget ( $ setting_value , $ newKey ) ; if ( count ( $ setting_value ) > 0 ) { // if we still have settings, update settings row $ query -> update ( [ 'setting_value' => json_encode ( $ setting_value ) ] ) ; } else { // if settings value remain blank, delete settings row $ query -> delete ( ) ; } } else { // if found only one key, delete settings row $ query -> delete ( ) ; } } $ this -> cache -> forget ( $ key ) ; }
Remove a settings from database and cache file

@param  string $key

@return void
Remove a settings from database and cache file