PHP code example of hiddeco / laravel-transip

1. Go to this page and download the library: Download hiddeco/laravel-transip 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/ */

    

hiddeco / laravel-transip example snippets


use TransIP\Laravel\Facades\TransIP;

$domainNames = TransIP::domain()->getDomainNames();
// and you're done

use TransIP\Laravel\Facades\TransIP;

$domainNames = TransIP::connection('alternative')->domain()->getDomainNames();

use TransIP\Laravel\Facades\TransIP;

TransIP::connection('main')->domain()->getDomainNames();
TransIP::domain()->getDomainNames();
TransIP::connection()->domain()->getDomainNames();
// are all the same because 

TransIP::getDefaultConnection();
// returns 'main' as set in the configuration file

TransIP::setDefaultConnection('alternative');
// the 'alternative' connection is now the default connection

use TransIP\Laravel\TransIPManager;

class Foo
{
	protected $transIP;
	
	public function __construct(TransIPManager $transIP)
	{
		$this->transIP;
	}
	
	public function bar()
	{
		$this->transIP->domain()->getDomainNames();
	}
}