praxisnetau / serverpilot-api Goto Github PK
View Code? Open in Web Editor NEWA wrapper and data model for the ServerPilot API implemented in PHP.
License: BSD 3-Clause "New" or "Revised" License
A wrapper and data model for the ServerPilot API implemented in PHP.
License: BSD 3-Clause "New" or "Revised" License
Would be great to see a function for listing all apps on a specified server. Something like...
$api->apps->listAll($serverID);
why no toData() on all models? it's really kinda handy
I'm trying to creat an app and keep receiving the following error
Array to string conversion
I'm just trying to do something real basic and it won't let me.
$sp = ServerPilotAPI::inst('MYCID', 'MYKEY');
$app = $sp->apps->create('shemphoward', 'I0F3Gn9GBsVl9YOs', 'php7.0', ['shemphoward.com']);
Tried it like this too. No luck
$app = $sp->apps->create('shemphoward', 'I0F3Gn9GBsVl9YOs', 'php7.0', 'shemphoward.com');
I'm using Laravel, and am creating a dropdown menu so customers can select their server when creating new apps. I want the menu to be real simple, something like:
<select name="server_id">
<option value="{{ SERVER_ID }}">{{ SERVER NAME }}</option>
</select>
Here's the code I'm using to build the array
<?php
namespace App;
use ServerPilot\ServerPilotAPI;
use Illuminate\Database\Eloquent\Model;
class ServerPilot extends Model
{
public static function listServers($option = null)
{
$sp = ServerPilotAPI::inst('MY_ID', 'MY_KEY');
$servers = $sp->servers->listAll();
if($option == 'dropdown') {
$array = [];
foreach($servers as $server) {
dd($server->id); // just trying to see the value...
$array[$value->id] = $value->name;
}
return $array;
}
return $servers;
}
}
However, when running that code I receive the following error
Cannot access protected property ServerPilot\Model\Server::$id
How can I retrieve the ID
and name
of the servers without having to do a lookup for each during the loop?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.