Laravel Forge API

News

February 28th, 2017

forge-api.png

Laravel Forge just announced it’s first official API that allows you to create and interact with your servers and sites.

This was a highly requested feature and the API includes support for all the features Forge provides including Servers, Services, Daemons, Firewall Rules, Sites, SSL, and more.

To get started login to your Forge account and from your account, you can generate your API token:

After you have your token, you can then start making requests with the bearer token:

1Authorization: Bearer API_TOKEN_HERE

If you are using Guzzle here is an example:

1$client->request('GET', '/api/v1/servers', [
2 'headers' => ['Authorization' => 'Bearer '.$forgeApiToken]
3]);

Check out the Forge API documentation for all the details.

Filed in:

Eric L. Barnes

Eric is the creator of Laravel News and has been covering Laravel since 2012.