PHP code example of webregulate / dev-companion

1. Go to this page and download the library: Download webregulate/dev-companion 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/ */

    

webregulate / dev-companion example snippets


'ssh_connections' => [
	'development' => [
		'branch' => 'development',
		'host' => 'dev.example.com',
		'port' => 22,
		'user' => 'forge',
		'base_path' => '/home/forge/dev.example.com',
		'commands' => 'cd {base_path}',
	],
],

use WebRegulate\DevCompanion\Classes\InlineCommand;

'commands' => [
	'refresh' => InlineCommand::make('Refresh development', function (InlineCommand $command) {
		$connection = $command->select('Server', $command->getSshConnectionKeys());

		$command
			->localCommand('npm run build')
			->sshCommand($connection, ['php artisan optimize:clear', 'exit']);
	}),
],

$command->download('development', 'storage/app/report.csv', 'storage/app/report.csv');

$command->download(
	'development',
	'storage/app/exports',
	'storage/app/exports',
	recursive: true,
	replace: true,
);

$command->upload('development', 'public/build', 'public/build', recursive: true);
bash
php artisan dev-companion:install
bash
php artisan dev-companion