Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Created December 6, 2016 20:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niraj-shah/a0b70682678defe416fb1c375af3603d to your computer and use it in GitHub Desktop.
Save niraj-shah/a0b70682678defe416fb1c375af3603d to your computer and use it in GitHub Desktop.
Laravel SSH Commands
// see if file exists on remote
SSH::into($env)->exists( 'path/on/remote/filename.extension' );
// upload file to remote
SSH::into($env)->put( 'path/to/local/filename', 'path/on/remote/filename' );
// run a command - only works on SSH connections
SSH::into($env)->run( 'shasum path/on/remote/filename.extension', function( $line ) {
// display output of command, by line
echo $line;
} );
// download file from remote
SSH::into($env)->get( 'path/on/remote/filename', 'path/to/download/filename' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment