PHPackages                             mpociot/blacksmith - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mpociot/blacksmith

ActiveLibrary[API Development](/categories/api)

mpociot/blacksmith
==================

The unofficial Laravel Forge API

0.3.1(9y ago)10317216[2 issues](https://github.com/mpociot/blacksmith/issues)MITPHPPHP &gt;=5.5.0

Since Nov 16Pushed 9y ago4 watchersCompare

[ Source](https://github.com/mpociot/blacksmith)[ Packagist](https://packagist.org/packages/mpociot/blacksmith)[ Docs](http://github.com/mpociot/blacksmith)[ RSS](/packages/mpociot-blacksmith/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (6)Versions (6)Used By (0)

Blacksmith - The unofficial Laravel Forge PHP API
=================================================

[](#blacksmith---the-unofficial-laravel-forge-php-api)

Laravel Forge is **awesome**, right? Yes it is - but there's one thing it's missing - a proper API.

That's why this library exists - Blacksmith is an unofficial [Laravel Forge API](http://forge.laravel.com) to automate common tasks.

The API is still improving and I will keep adding features, as I need them.

Getting Started
---------------

[](#getting-started)

```
use Mpociot\Blacksmith\Blacksmith;

$blacksmith = new Blacksmith($email, $password);
```

Available methods
-----------------

[](#available-methods)

### Get all active servers

[](#get-all-active-servers)

Returns a Collection of `Server` objects.

```
$activeServers = $blacksmith->getActiveServers();
```

### Get all sites for all servers

[](#get-all-sites-for-all-servers)

Returns a Collection of `Site` objects.

```
$sites = $blacksmith->getSites();
```

### Get a server by its ID

[](#get-a-server-by-its-id)

Returns a single `Server` object.

```
$server = $blacksmith->getServer(1);
```

### Add a server to Forge

[](#add-a-server-to-forge)

Returns a single `Server` object with a provision url.

The following example will create a Load Balancer with a custom provider

```
$server = $blacksmith->addServer([
    'backups' => false,
    'database' => 'forge',
    'hhvm' => false,
    'ip_address' => '94.212.124.121',
    'maria' => false,
    'name' => 'harmonious-lagoon',
    'nodeBalancer' => true,
    'old_php' => false,
    'php_version' => 'php70',
    'private_ip_address' => '10.0.0.2',
    'provider' => 'custom',
    'size' => '2',
    'timezone' => 'Europe/Berlin',
]);
```

### Get a site by its ID

[](#get-a-site-by-its-id)

Returns a single `Site` object.

```
$site = $blacksmith->getSite(1);
```

### Get all circles

[](#get-all-circles)

Returns a Collection of `Circle` objects of the user.

```
$circles = $blacksmith->getCircles();
```

### Get a circle by its ID

[](#get-a-circle-by-its-id)

Returns a single `Circle` object.

```
$circle = $blacksmith->getCircle(1);
```

### Add a new circle

[](#add-a-new-circle)

Returns a single `Circle` object.

```
$circle = $blacksmith->addCircle('Name of Circle');
```

### Get all recipes

[](#get-all-recipes)

Returns a Collection of `Recipe` objects.

```
$recipes = $blacksmith->getRecipes();
```

### Get a recipe by its ID

[](#get-a-recipe-by-its-id)

Returns a single `Recipe` object.

```
$recipe = $blacksmith->getRecipe(1);
```

### Add a new recipe

[](#add-a-new-recipe)

Returns a single `Recipe` object.

```
$recipe = $blacksmith->addRecipe('RecipeName', 'root', 'Recipe contents');
```

Server methods
--------------

[](#server-methods)

### Get Sites

[](#get-sites)

Returns a Collection of `Site` objects for the server.

```
$sites = $server->getSites();
```

### Add a new site

[](#add-a-new-site)

Returns a the newly created `Site` object or throws an exception if errors occur.

```
$newSite = $server->addSite($site_name, $project_type = 'php', $directory = '/public', $wildcards = false);
```

### Add a new SSH key

[](#add-a-new-ssh-key)

Add a SSH key to a server

```
$server->addSSHKey('Name SSH key', 'Contents of SSH key');
```

### Remove a SSH key from a server

[](#remove-a-ssh-key-from-a-server)

```
$server->removeSSHKey(1);
```

### Update Metadata

[](#update-metadata)

Update the metadata of the current site, and return an updated `Server` object or throws an exception if errors occur.

```
$server = $server->updateMetadata($server_name, $ip_address, $private_ip_address, $size);
```

### Get Schedules Jobs

[](#get-schedules-jobs)

Returns a Collection of `ScheduledJob` objects for the server.

```
$jobs = $server->getScheduledJobs();
```

### Add a new scheduled job

[](#add-a-new-scheduled-job)

Returns a the newly created `ScheduledJob` object or throws an exception if errors occur.

```
$newJob = $server->addScheduledJob($command, $user = 'forge', $frequency = 'minutely');
```

### toArray

[](#toarray)

Returns an array containing all available server information.

```
$data = $server->toArray();
```

Site methods
------------

[](#site-methods)

### Get Environment

[](#get-environment)

Returns the configured .env file

```
$env_content = $site->getEnvironment();
```

### Install an application

[](#install-an-application)

Install and deploy an application to the site.

```
$site->installApp($repository, $provider = 'github', $branch = 'master', $composer = true, $migrate = false);
```

### Deploy an application

[](#deploy-an-application)

Deploys an application on this site.

```
$site->deploy();
```

### Get last deployment log

[](#get-last-deployment-log)

Returns the last deployment log for this site.

```
$site->deployLog();
```

### toArray

[](#toarray-1)

Returns an array containing all available site information.

```
$data = $site->toArray();
```

Circle methods
--------------

[](#circle-methods)

### Invite a member by email

[](#invite-a-member-by-email)

Returns a fresh `Circle` object or throws an exception if errors occur.

```
$circle = $circle->inviteMember('email@company.com');
```

### Set all circle members

[](#set-all-circle-members)

If you want to delete a member you update a circle with all member id's. It return a fresh `Circle` object.

```
$circle = $circle->setMembers([1,2]);
```

### Set all circle servers

[](#set-all-circle-servers)

If you want to add or delete a server from the circle you update a circle with all server id's. It return a fresh `Circle` object.

```
$circle = $circle->setServers([1,2]);
```

Recipe methods
--------------

[](#recipe-methods)

### Update a Recipe

[](#update-a-recipe)

```
$recipe = $recipe->update($name, $user, $script);
```

License
-------

[](#license)

Blacksmith is free software distributed under the terms of the MIT license.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

5

Last Release

3508d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b46cb765edab3c6a765bd466bb2a530e0e95cbd74cf7dfc250c59a2b029b73ca?d=identicon)[mpociot](/maintainers/mpociot)

---

Top Contributors

[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (18 commits)")[![petericebear](https://avatars.githubusercontent.com/u/339796?v=4)](https://github.com/petericebear "petericebear (18 commits)")[![djekl](https://avatars.githubusercontent.com/u/1119714?v=4)](https://github.com/djekl "djekl (4 commits)")[![leevigraham](https://avatars.githubusercontent.com/u/25124?v=4)](https://github.com/leevigraham "leevigraham (1 commits)")

---

Tags

apilaravelforge

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mpociot-blacksmith/health.svg)

```
[![Health](https://phpackages.com/badges/mpociot-blacksmith/health.svg)](https://phpackages.com/packages/mpociot-blacksmith)
```

###  Alternatives

[joisarjignesh/bigbluebutton

BigBlueButton Server API Library for Laravel

162151.8k1](/packages/joisarjignesh-bigbluebutton)[davmixcool/lumen-apidoc-generator

Generate beautiful API documentation using Dingo router from your Lumen application

173.1k](/packages/davmixcool-lumen-apidoc-generator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
