PHPackages                             dylan7778/forge-deploy - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. dylan7778/forge-deploy

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

dylan7778/forge-deploy
======================

A simple tool for safely deploying code to Laravel Forge.

v1.1.5(3y ago)2151MITPHPPHP &gt;=7.0

Since Sep 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dylan7778/forge-deploy)[ Packagist](https://packagist.org/packages/dylan7778/forge-deploy)[ RSS](/packages/dylan7778-forge-deploy/feed)WikiDiscussions master Synced today

READMEChangelog (2)DependenciesVersions (18)Used By (0)

[![Contributors](https://camo.githubusercontent.com/78816650b64f285399dc026d38289cfb9fad1e52d6ebcb671c67e3ddc37b63f4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f64796c616e373737382f666f7267652d6465706c6f792e7376673f7374796c653d666c61742d737175617265)](https://github.com/dylan7778/forge-deploy/graphs/contributors)[![Forks](https://camo.githubusercontent.com/d8f64aa0edce8ed51e4af12b1426f12415606635874e68f8a0680441fc59b653/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f64796c616e373737382f666f7267652d6465706c6f792e7376673f7374796c653d666c61742d737175617265)](https://github.com/dylan7778/forge-deploy/network/members)[![Stargazers](https://camo.githubusercontent.com/8143738fcf851221a83625b2795d15939eb63b40442c9af53fa6f6c91d6b9bf6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f64796c616e373737382f666f7267652d6465706c6f792e7376673f7374796c653d666c61742d737175617265)](https://github.com/dylan7778/forge-deploy/stargazers)[![Issues](https://camo.githubusercontent.com/c944370f3ae50e12bc9b9429647e36b2101cfeda6eaab5c5af134d270c35596f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f64796c616e373737382f666f7267652d6465706c6f792e7376673f7374796c653d666c61742d737175617265)](https://github.com/dylan7778/forge-deploy/issues)[![License](https://camo.githubusercontent.com/1189d8994a7043552e27457172a920d0742c5fb1ffe85b51364561ef28fff4d3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f64796c616e373737382f666f7267652d6465706c6f792e7376673f7374796c653d666c61742d737175617265)](https://github.com/dylan7778/forge-deploy/blob/master/LICENSE.md)

### Forge-Deploy

[](#forge-deploy)

 A safer, more robust way to deploy your code to Laravel Forge.

 A lightweight Laravel package developed by:

 [ ![Logo](images/logo.jpg) ](https://dandillon.dev)

[DanDillon.dev](https://dandillon.dev)

Table of Contents
-----------------

[](#table-of-contents)

- [About the Project](#about-the-project)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)

About The Project
-----------------

[](#about-the-project)

Forge Deploy is a lightweight package meant to help you make safe deployments to multiple Forge environments. It is not meant as a replacement for a fully featured CI, but rather as a simple tool to run some sanity checks and basic npm operations before pushing your code live. For example, this package will check to make sure you are pushing the correct branch to the correct origin, run the appropriate NPM command for that environment, check for any uncommitted changes, and even verify that you are in the proper repository before allowing you to push the code.

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

[](#getting-started)

### Prerequisites

[](#prerequisites)

- This package works with Laravel 5+ and PHP 7+, and utilizes package auto-discovery.
- This package utilizes the local file system to read your git config file, so you can only use this in a git-controlled project. It is currently configured to work on Linux style systems, such as Mac. Windows support is coming soon.

### Installation

[](#installation)

1. Add the package to your project using composer

```
composer require dylan7778/forge-deploy --dev
```

2. Publish config file

```
php artisan vendor:publish
```

Usage
-----

[](#usage)

To use the package, you will first need to set up some basic paramters in the published config file. We recommend you store these paramaters in your ENV file, but you can store them directly in the config file if you wish. You will have the option to set up multiple environments, each stored as an array of paramters for that specific deployment target.

Global Parameters:

- 'base\_directory': The absolute path to your project on your local filesystem (e.g. /Users/user/php/project-name)

Environment Specific Parameters:

- 'npm\_build\_type': production/dev - set this appropriately depending on the environment
- 'deployment\_webhook': Your deployment webhook provided in the Laravel Forge dashboard
- 'git\_branch': The branch you wish to deploy for this environment (e.g. 'master','dev' or 'staging')

An example config featuring a production and staging environment is shown below:

```
'base_directory' => '/Users/user/php/project-name',
'environments' => [
    'production' => [
        'npm_build_type' => 'production',
        'deployment_webhook' => 'https://forge.laravel.com/servers/1234567/sites/1234567/deploy/...',
        'git_branch' => 'master',
    ],
    'staging' => [
        'npm_build_type' => 'dev',
        'deployment_webhook' => 'https://forge.laravel.com/servers/4567891/sites/4567891/deploy/...',
        'git_branch' => 'staging',
    ],
]

```

Once you have finished the basic setup, you can now run your deployment code directly from your root folder. The command is:

```
php artisan deploy {environment} {run_npm?}
```

There are two flags in this command. The first is the environment name, and the other is an optional paramter which tells the script whether to execute the `npm run` build code before deploying. In some cases, like when modifying only backend PHP files, you may not want to have to wait for the `npm run production` command when you deploy, so you can manually override by adding this option. By default, the npm commands will always be run if you do not specify the 'no\_npm' flag. Here are some examples:

- Deploy to production environment and include the npm build command:

```
php artisan deploy production
```

- Deploy to staging environment and do not include the npm build command:

```
php artisan deploy staging no_npm
```

You may also deploy to all of your environments at once by using "all" as your environment keyword. Please note that this can only be done when you are working on the same branch for each environment. This package will automatically check to make sure that each environment is on the same branch and has a valid webhook, and then it will push the changes to each environment using the following command:

- Deploy to all environments:

```
php artisan deploy all
```

### Important Notes

[](#important-notes)

- Before using this package, please make sure that you turn off Quick Deploy from the Forge dashboard.
- This package is meant to save you from accidentally deploying code from the wrong branch onto your live server. In order to do this, a check is made to compare your current git branch vs. the expected git branch in your config file for the given environment. In addition, a check is made to make sure that you have a clean commit to your chosen branch, so you will not be able to deploy until you commit or stash all changes.
- This package does NOT verify deployment success at the server level, it only verifies that the webhook is sent to Forge and receives a 200 status code in response. If an error occurs on your server, it is your responsibliity to monitor for that and handle it appropriately. Handling this automatically with Forge webhooks will be a goal of a future release.

Contributing
------------

[](#contributing)

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

License
-------

[](#license)

Distributed under the MIT License. See `LICENSE.md` for more information.

Contact
-------

[](#contact)

Dan Dillon - [@dandillondev](https://twitter.com/dandillondev) -

Project Link:

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~48 days

Recently: every ~178 days

Total

16

Last Release

1386d ago

PHP version history (2 changes)v1.0.0PHP ^7.0

v1.1.0PHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10456109?v=4)[dylan7778](/maintainers/dylan7778)[@dylan7778](https://github.com/dylan7778)

---

Top Contributors

[![dylan7778](https://avatars.githubusercontent.com/u/10456109?v=4)](https://github.com/dylan7778 "dylan7778 (27 commits)")

### Embed Badge

![Health badge](/badges/dylan7778-forge-deploy/health.svg)

```
[![Health](https://phpackages.com/badges/dylan7778-forge-deploy/health.svg)](https://phpackages.com/packages/dylan7778-forge-deploy)
```

###  Alternatives

[in2code/in2publish_core

Content publishing extension to connect stage and production server

40143.4k](/packages/in2code-in2publish-core)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4778.9k](/packages/tiamo-phpas2)[wapmorgan/php-rpm-packager

RPM packager for PHP applications.

106.6k](/packages/wapmorgan-php-rpm-packager)

PHPackages © 2026

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