laravel['config']['app.mcryptKey']; $cipher = $this->laravel['config']['app.mcryptCipher']; $legacy = new McryptEncrypter($key, $cipher); $caches = DB::select('SELECT * FROM cache'); foreach ($caches as $cache) { $newValue = encrypt( $legacy->decrypt($cache->value) ); DB::update('UPDATE cache SET value = ? WHERE key = ?', [$cache->key, $newValue]); $this->info("Updated {$cache->key}"); } } }