PHPackages                             sansanlabs/laravel-git-ftp-deployer - 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. sansanlabs/laravel-git-ftp-deployer

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

sansanlabs/laravel-git-ftp-deployer
===================================

Laravel Git-FTP deployment package with git status checking and build integration

v1.2.0(10mo ago)0153[5 PRs](https://github.com/sansanlabs/laravel-git-ftp-deployer/pulls)MITPHPPHP ^8.2CI passing

Since Jul 3Pushed 1mo agoCompare

[ Source](https://github.com/sansanlabs/laravel-git-ftp-deployer)[ Packagist](https://packagist.org/packages/sansanlabs/laravel-git-ftp-deployer)[ Docs](https://github.com/sansanlabs/laravel-git-ftp-deployer)[ GitHub Sponsors](https://github.com/sansanlabs)[ RSS](/packages/sansanlabs-laravel-git-ftp-deployer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (13)Versions (9)Used By (0)

Laravel Git-FTP Deployer
========================

[](#laravel-git-ftp-deployer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/31c80fcf937170753ef45cb645415e9420eefb808c70884c306faa6005b1408c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616e73616e6c6162732f6c61726176656c2d6769742d6674702d6465706c6f7965722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sansanlabs/laravel-git-ftp-deployer)[![GitHub Tests Action Status](https://camo.githubusercontent.com/deb066f705706c0a83e11ed090ad6a863b46bec9a883f40f9ab57a27c2804c66/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73616e73616e6c6162732f6c61726176656c2d6769742d6674702d6465706c6f7965722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/sansanlabs/laravel-git-ftp-deployer/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/831d5e1abd4d1fdc13e7b2fb1368398112538d1cde9189bf5ea14a5ccfc1b2d1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73616e73616e6c6162732f6c61726176656c2d6769742d6674702d6465706c6f7965722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/sansanlabs/laravel-git-ftp-deployer/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/cd92053c7dfa3636196d97152a0a10eeb1243b898203b2b11d541734552cedd5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616e73616e6c6162732f6c61726176656c2d6769742d6674702d6465706c6f7965722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sansanlabs/laravel-git-ftp-deployer)

A Laravel package for deploying applications via FTP with git status checking and build process integration.

Features
--------

[](#features)

- ✅ Check git status before deployment
- ✅ Prevent deployment with uncommitted changes
- ✅ Prevent deployment with unpushed commits
- ✅ Run build commands (npm, yarn, etc.) before deployment
- ✅ Support multiple environments (staging, production)
- ✅ Beautiful tree view for uncommitted changes
- ✅ Cross-platform support (Windows, Linux, macOS)
- ✅ Configurable git-ftp options

Requirements
------------

[](#requirements)

- PHP ^8.2
- Laravel ^10.0|^11.0|^12.0
- git-ftp installed on your system

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require sansanlabs/laravel-git-ftp-deployer
```

You can publish the config file with:

```
php artisan vendor:publish --tag="git-ftp-deployer-config"
```

This is the contents of the published config file:

```
return [
  /*
    |--------------------------------------------------------------------------
    | Git-FTP Deploy Configuration
    |--------------------------------------------------------------------------
    |
    | Configuration for Git-FTP deployment package
    |
    */
  "environments" => [
    "staging" => [
      "host" => env("STAGING_FTP_HOST"),
      "username" => env("STAGING_FTP_USERNAME"),
      "password" => env("STAGING_FTP_PASSWORD"),
      "path" => env("STAGING_FTP_PATH", "/website/"),
    ],
    "production" => [
      "host" => env("PRODUCTION_FTP_HOST"),
      "username" => env("PRODUCTION_FTP_USERNAME"),
      "password" => env("PRODUCTION_FTP_PASSWORD"),
      "path" => env("PRODUCTION_FTP_PATH", "/website/"),
    ],
  ],

  /*
    |--------------------------------------------------------------------------
    | Build Command
    |--------------------------------------------------------------------------
    |
    | The command to run before deployment
    |
    */
  "build_command" => env("GIT_FTP_BUILD_COMMAND", "npm run build"),

  /*
    |--------------------------------------------------------------------------
    | Git Bash Path
    |--------------------------------------------------------------------------
    |
    | Path to Git Bash executable (default on Windows)
    |
    */
  "git_bash_path" => env("GIT_BASH_PATH", "C:\\Program Files\\Git\\bin\\bash.exe"),

  /*
    |--------------------------------------------------------------------------
    | Git-FTP Options
    |--------------------------------------------------------------------------
    |
    | Additional options for git-ftp command
    |
    */
  "git_ftp_options" => [
    "force" => env("GIT_FTP_FORCE", true),
    "verbose" => env("GIT_FTP_VERBOSE", true),
    "auto_init" => env("GIT_FTP_AUTO_INIT", true),
  ],
];
```

Configuration
-------------

[](#configuration)

Add your FTP credentials to your .env file:

```
# Staging Environment
STAGING_FTP_HOST=ftp.yoursite.com
STAGING_FTP_USERNAME=your-username
STAGING_FTP_PASSWORD=your-password
STAGING_FTP_PATH=/public_html/staging/

# Production Environment
PROD_FTP_HOST=ftp.yoursite.com
PROD_FTP_USERNAME=your-username
PROD_FTP_PASSWORD=your-password
PROD_FTP_PATH=/public_html/

# Build Command (optional)
FTP_BUILD_COMMAND="npm run build"

# Git Bash Path
GIT_BASH_PATH="C:\Program Files\Git\bin\bash.exe"
```

Usage
-----

[](#usage)

### Basic Deployment

[](#basic-deployment)

#### Deploy to staging:

[](#deploy-to-staging)

```
php artisan deploy:ftp --env=staging
```

#### Deploy to production:

[](#deploy-to-production)

```
php artisan deploy:ftp --env=production
```

#### Interactive environment selection:

[](#interactive-environment-selection)

```
php artisan deploy:ftp
```

### Skip Build Process

[](#skip-build-process)

#### Skip the build command:

[](#skip-the-build-command)

```
php artisan deploy:ftp --skip-build
```

Configuration Options
---------------------

[](#configuration-options)

The package configuration file config/ftp-deploy.php allows you to customize:

- Environments: Define multiple deployment environments
- Build Command: Command to run before deployment (default: npm run build)
- Git Bash Path: Path to Git Bash executable (Windows only)
- Git FTP Options: Additional options for git-ftp command

Git Status Checking
-------------------

[](#git-status-checking)

The package will check for:

1. Uncommitted Changes: Files that have been modified but not committed
2. Unpushed Commits: Commits that exist locally but haven't been pushed to origin

If either condition is found, deployment will be aborted with a detailed report.

Build Process
-------------

[](#build-process)

Before deployment, the package will run your configured build command (default: npm run build). This ensures your assets are compiled and ready for production.

FTP Deployment
--------------

[](#ftp-deployment)

The package uses git-ftp to efficiently deploy only changed files to your FTP server. It supports:

- Force push
- Verbose output
- Auto-initialization of git-ftp
- Custom sync roots and paths

Testing
-------

[](#testing)

Upcoming ...

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Edi kurniawan](https://github.com/edikurniawan-dev)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance75

Regular maintenance activity

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84% 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 ~0 days

Total

5

Last Release

313d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4debb9533a0ca6688ded80d730a8e978a103b90bf0c5c22c59fa106eb92711c4?d=identicon)[sansanlabs](/maintainers/sansanlabs)

---

Top Contributors

[![edikurniawan-dev](https://avatars.githubusercontent.com/u/50087198?v=4)](https://github.com/edikurniawan-dev "edikurniawan-dev (21 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

ftplaraveldeploymentsansanlabslaravel-git-ftp-deployergit-ftp

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/sansanlabs-laravel-git-ftp-deployer/health.svg)

```
[![Health](https://phpackages.com/badges/sansanlabs-laravel-git-ftp-deployer/health.svg)](https://phpackages.com/packages/sansanlabs-laravel-git-ftp-deployer)
```

###  Alternatives

[timokoerber/laravel-one-time-operations

Run operations once after deployment - just like you do it with migrations!

6481.7M11](/packages/timokoerber-laravel-one-time-operations)[spatie/laravel-horizon-watcher

Automatically restart Horizon when local PHP files change

2631.9M](/packages/spatie-laravel-horizon-watcher)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[fadion/maneuver

Easily deploy Laravel projects via FTP or SFTP, using Git for versioning.

1729.1k](/packages/fadion-maneuver)[innocenzi/deployer-recipe-forge

Seamless zero-downtime deployment on Forge with Deployer

1916.6k](/packages/innocenzi-deployer-recipe-forge)

PHPackages © 2026

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