PHPackages                             phanan/remote - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. phanan/remote

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

phanan/remote
=============

Bringing the Remote library back to Laravel 5.

2.0.1(10y ago)2931.5k4[1 issues](https://github.com/phanan/remote/issues)[3 PRs](https://github.com/phanan/remote/pulls)1MITPHPPHP &gt;=5.4.0

Since Mar 26Pushed 6y ago4 watchersCompare

[ Source](https://github.com/phanan/remote)[ Packagist](https://packagist.org/packages/phanan/remote)[ Docs](https://github.com/phanan/remote)[ RSS](/packages/phanan-remote/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (8)Used By (1)

Remote
======

[](#remote)

[![Build Status](https://camo.githubusercontent.com/e77370c7055079ccf791ca1801c2e963e907c979535a71f8484161296ab40bb9/68747470733a2f2f7472617669732d63692e6f72672f7068616e616e2f72656d6f74652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/phanan/remote)[![Dependency Status](https://camo.githubusercontent.com/9e7c4092e8ffa66c104ce479bf207c3e9991717fd576742e3dffe79cbf543b3e/68747470733a2f2f67656d6e617369756d2e636f6d2f7068616e616e2f72656d6f74652e737667)](https://gemnasium.com/phanan/remote)[![License](https://camo.githubusercontent.com/692cef3af01b94af8e74a20cf357cfd305850ab73d955335f23eaaae241e0dfe/68747470733a2f2f706f7365722e707567782e6f72672f7068616e616e2f72656d6f74652f6c6963656e73652e737667)](https://packagist.org/packages/phanan/remote)

*Remote* is a simple package that brings the ability to do remote connections back into Laravel 5. This package makes use of the awesome [phpseclib](https://github.com/phpseclib/phpseclib) behind the scene.

Requirements
------------

[](#requirements)

- PHP &gt;= 5.4
- Anything required by phpseclib

Installation
------------

[](#installation)

First, require `phanan/remote` into your `composer.json` and run `composer update`.

```
    "require": {
        "laravel/framework": "5.1.*",
        "phanan/remote": "2.0.*"
    },

```

After the package is downloaded, open `config/app.php` and add its service provider class:

```
    'providers' => [
        /*
         * Application Service Providers...
         */
        App\Providers\AppServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,

        PhanAn\Remote\RemoteServiceProvider::class,
    ],
```

Now if you need a sample configuration file – you don’t actually, see Usage for array-based login:

```
php artisan vendor:publish
```

Look for a `remote.php` file under your `config` directory and modify it to fit your needs.

Usage
-----

[](#usage)

Using `Remote` is dead simple: Just initialize a `PhanAn\Remote\Remote` object, say `$connection`. The constructor accepts two arguments, none of which is required:

- `$env` (`string|array`): The key of the remote connection array found in `config/remote.php` if a string, or the configuration array itself if an array. Defaults to an empty string, in which case the default connection will be used.
- `$auto_login` (`boolean`): Whether or not the connection should attempt to log into the remote server upon class construction. Defaults to `true`.

Here's where the magic happens. Like, literally. `Remote` makes use of the magic function `__call()` to pass all unrecognized methods to the `phpseclib\Net\SFTP` object underneath. Which means, you can call any `phpseclib\Net\SFTP` method directly on a `Remote` object:

```
