Last active
February 18, 2017 02:06
-
-
Save shawnsandy/39754749fb2472c3d8e050f3d0553d09 to your computer and use it in GitHub Desktop.
SSH commands in Laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Collective\Remote\RemoteFacade as SSH; | |
class SampleSSH { | |
public function getFile() | |
{ | |
try { | |
SSH::into('production')->get('/var/www/.env', public_path('/env/example.env-' . Carbon::now()), function ($line) { | |
Log::info($line); | |
return $line; | |
}); | |
return "success"; | |
} catch (Exception $exception) { | |
return $exception->getMessage(); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment