PHP code example of spatie / laravel-remote

1. Go to this page and download the library: Download spatie/laravel-remote library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

spatie / laravel-remote example snippets


return [
    /*
     * This host will be used if none is specified
     * when executing the `remote` command.
     */
    'default_host' => 'default',
    
    /*
    * When set to true, A confirmation prompt will be shown before executing the `remote` command.
    */
    'needs_confirmation' => env('REMOTE_NEEDS_CONFIRMATION', false),

    /*
     * Here you can define the hosts where the commands should be executed.
     */
    'hosts' => [
        'default' => [
            'host' => env('REMOTE_HOST'),

            'port' => env('REMOTE_PORT', 22),

            'user' => env('REMOTE_USER'),

            /*
             * The package will cd to the given path before executing the given command.
             */
            'path' => env('REMOTE_PATH'),
            
            /*
             * Optional. Path to the private key on your computer if your remote server 
bash
php artisan remote cache:clear
bash
php artisan vendor:publish --tag="remote-config"
bash
php artisan remote cache:clear
bash
php artisan remote cache:clear --host=my-other-host