copy() public method

Copy the .env file to the given destination.
public copy ( string $destination, boolean $excludeValues = false ) : boolean
$destination string Full path to copy the file to
$excludeValues boolean Whether or not to include values
return boolean
Example #1
0
 /**
  * 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());
     }
 }