argument('key'); $value = $this->argument('value'); $originalValue = env($key); if (file_exists($path)) { $file = file_get_contents($path); $newConfig = str_replace($key . '=' . $originalValue, $key . '=' . $value, $file); file_put_contents( $path, $newConfig ); } $this->info('>> Changed value! It may now be accessed via env() or config() if there\'s a file for it.'); } }