comment(''); $this->comment('====================================='); $this->comment(''); if(!$this->argument('url')){ $this->info('url: '.Config::get('app.url')); } else{ try { $path = app_path('config/'.App::environment().'/app.php'); $contents = File::get($path); $contents = preg_replace("/'url' => '(.*?)'/", "'url' => '".$this->argument('url')."'", $contents); File::put($path, $contents); $this->info('Sucessfully updated the url!'); } catch(Exception $e){ $this->info('There was a problem updating the url!'); $this->info(json_encode($e->getMessage())); die; } } } }