WPHammer
Log in

Forge API Configuration

WPHammer connects to Laravel Forge to manage servers and sites. Each team configures its own Forge API token and optional server tags to control which Forge resources are synced.

API token setup

The Forge API token is stored as an encrypted field (forge_api_key) on the Team model. You configure it from the Forge settings page (teams/settings/forge).

The settings page provides actions to:

  • Add or update the Forge API key
  • Remove the Forge API key
  • Test connectivity by verifying the token against the Forge API

The hasForgeApiKey() method on the Team model checks whether a token has been configured. Many operations — syncing servers, creating sites, managing deployments — require a valid Forge API token.

Only users with the canManageTeam permission (Owner and Admin) can modify the Forge API key, as enforced by the TeamPolicy@manageForgeKey method.

Server tags

Forge server tags let you filter which servers are synced into WPHammer. The forge_tags field on the Team model stores an array of tag strings. During a sync, only servers in Forge that match at least one of the configured tags are imported.

From the settings page, you can:

  • Add a tag — appends a new tag to the filter list
  • Remove a tag — removes a tag by index from the list

If no tags are configured, all servers from the Forge account are synced.

Forge username

The optional forge_username field stores the Forge account username associated with the API key. This is used for display purposes and server identification.

ScrapingBee API key

The Forge settings page also manages the ScrapingBee API key, used for visual monitoring (canary checks). Like the Forge key, it is stored encrypted on the Team model and can be added, updated, or removed from the settings page.

The hasScrapingbeeApiKey() method checks whether a ScrapingBee key is configured.

Related