PHP code example of kylewlawrence / gridpane-laravel
1. Go to this page and download the library: Download kylewlawrence/gridpane-laravel 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/ */
// Get all Servers
GridPane::server()->getAll();
// Create a new server
$newServer = $client->server()->create([
'servername' => 'hal9000',
'ip' => '199.199.199.199',
'datacenter' => 'space-station-v',
'webserver' => 'nginx',
'database' => 'percona'
]);
print_r($newServer);
// Delete a server
GridPane::server(12345)->delete();
use KyleWLawrence\GridPane\Services\GridPaneService;
class MyClass {
public function __construct(GridPaneService $gridpane_service) {
$this->gridpane_service = $gridpane_service;
}
public function getSite() {
$this->gridpane_service->site()->get(12345);
}
}