tanjemark/laravel-remote

Execute commands remotely using SSH.


Keywords
database, sync, commands, ssh, remote, laravel, artisan, db-sync
License
MIT

Documentation

Laravel Remote

GitHub issues GitHub forks GitHub stars GitHub license Twitter

Execute commands remotely using SSH.


Installation

Require this package in your composer.json and update your dependencies:

$ composer require tanjemark/laravel-remote

Since this package supports Laravel's Package Auto-Discovery you don't need to manually register the ServiceProvider.

After that, publish the configuration file:

$ php artisan vendor:publish --provider="Tanjemark\LaravelRemote\RemoteServiceProvider"

You're gonna need to add a remote server to the configuration file.

Usage

Artisan

$ php artisan remote:artisan '@alias' 'command'
# Example
$ php artisan remote:artisan @live migrate 

Database sync

If you have provided a fake setting in config/remote.php the provided columns will be faked. Making it possible to make your sync GDPR approved 😁

$ php artisan remote:db-sync '@from_alias' '@to_alias'
# Example
$ php artisan remote:db-sync @live @local --fake

Requirements

ssh2 have to be installed on all your servers.

$ sudo apt-get install php7.2-ssh2

License

The MIT License (MIT). Please see License File for more information.