Laravel Forge PHP SDK

Laravel Forge PHP SDK

Laravel Forge announced it’s first official API back in February and we have seen a lot of interesting uses like the F-Bar Mac app. Today, Mohamed Said released a PHP SDK for the API that covers all the features.

Here is an example of creating a new server with this SDK:

$server = $forge->createServer([
    "provider"=> "ocean2",
    "credential_id"=> 1,
    "name"=> "test-via-api",
    "size"=> "512MB",
    "database"=> "test123",
    "php_version"=> "php71",
    "region"=> "ams2"
]);

Of course, it also allows you to do much more and it works with the familiar Laravel expressive syntax. As an example take a look at more of the server commands available:

$server->update(array $data)
$server->delete()
$server->revokeAccess()
$server->reconnect()
$server->reactivate()
$server->rebootMysql()
$server->stopMysql()
$server->rebootPostgres()
$server->stopPostgres()
$server->rebootNginx()
$server->stopNginx()
$server->installBlackfire(array $data)
$server->removeBlackfire()
$server->installPapertrail(array $data)
$server->removePapertrail()

The SDK is freely available under the MIT license and it’s available on Github. The readme includes plenty of examples and explanation for working with the SDK.


Filed in: News / Forge


Newsletter

Join the weekly newsletter and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

Senior Laravel Developer (Full-Stack)
Munich
Volunteer Vision GmbH
Full-Stack Developer
Tampa
Nu Image Medical
Senior Software Developer
Remote (US ONLY)/Kenilworth, NJ
Diversified
Senior Back-end Laravel API Developer - Immediate Contract (Full Time)
Remote
ApproveMe // Document Signing
Web Development Project Manager
Houston, TX
Swyft Filings
Experienced Laravel/VueJS Developer (Freelance)
Remote (preferably in the US)
Prosperly LLC
Senior React / Laravel Developer
Remote
The C.A.S.E. Engineering Group