/** * Execute the console command. * * @return void */ public function handle() { $env = new Env(base_path('.env')); $name = (string) $this->option('name'); try { $env->copy(base_path($name, Env::COPY_FOR_DISTRIBUTION)); return $this->comment("Successfully created the file [{$name}]"); } catch (\Exception $e) { return $this->error($e->getMessage()); } }