PHPackages                             melody-wen/laravel-envoy - 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. melody-wen/laravel-envoy

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

melody-wen/laravel-envoy
========================

1.1.1(7y ago)311HTML

Since Nov 8Pushed 7y ago1 watchersCompare

[ Source](https://github.com/MelodyWen/laravel-envoy)[ Packagist](https://packagist.org/packages/melody-wen/laravel-envoy)[ RSS](/packages/melody-wen-laravel-envoy/feed)WikiDiscussions master Synced yesterday

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

laravel 中 envoy 远程部署的示例代码；
==========================

[](#laravel-中-envoy-远程部署的示例代码)

第一部分 对 envoy.blade.php 的概述
--------------------------

[](#第一部分-对-envoybladephp-的概述)

笔者把常用的命令封装成包（这个组件）

### 1.1 在入口文件中仅仅只需要写以下代码即可运用此组件

[](#11-在入口文件中仅仅只需要写以下代码即可运用此组件)

```
@servers(['web' => 'root@192.168.33.11'])
@import('vendor/mr-jiawen/laravel-envoy/bootstrap.blade.php')

```

### 1. 其中bootstrap.blade.php 为引导文件：

[](#1-其中bootstrapbladephp-为引导文件)

> 包括全局变量和子模板

```
# 系统变量，禁止更改， 除非把此包进行本地化操作
$envoy_system_url = 'vendor/mr-jiawen/laravel-envoy/';

# php版本 (默认)
$php_version=7.1

# 虚拟主机的 host 地址 (默认)
$host = 'localhost'

# 虚拟主机的 项目根目录 (默认)
$root_dir = '/vagrant'

# 使用的 php-fpm 的版本名称 (默认)
$php_fpm = 7.1

# 使用的项目名称 (默认)
$project_name = 'laravel'

# 使用php的类型 一种为 Sock 、 一种为FastCGI (默认是 Sock)
$php_type = 'Sock';

```

### 2. 环境远程部署

[](#2-环境远程部署)

1. web环境的初始化: 会安装 nginx mysql redis php git composer 等等

    ```
    envoy run story-linux
    envoy run story-php-install --php_version=7.1

    ```
2. 新建nginx站点 (新建一个站点需要传递 fpm值 \[php5.6,php7.0,php7.1,php7.2\]，项目名称、域名)

    ```
    envoy run task-nginx-site-add  --php_fpm=php7.0 --project_name=laravel --host=www.cjw.com --php_type=FastCGI

    ```

    - 此站点配置主要是针对与laravel 的项目站点配置，它会自动配置到项目的public下面
    - 根路径已经是设置好了，默认值是 `/vagrant`,如果是线上，请改为 `/var/www`
    - 同一个主机里，不同的项目可以使用 不同的php版本。指定php-fpm版本即可
3. 移除站点

    ```
    envoy run task-nginx-site-remove --host=www.cjw.com

    ```

    - 原理是直接删除站点软连接，然后重启nginx
4. 安装多个不同版本的php, 可以是 php5.6,php7.0,php7.1.

    ```
    envoy run task-php-install --php_version=php7.0

    ```
5. php 常规优化 , 可以是 php5.6,php7.0,php7.1

    ```
    envoy run task-php-optimize --php_version=php7.0

    ```
6. php 是否展示错误

    ```
     envoy run task-php-display_errors-on --php_version=php7.0   展示错误
     envoy run task-php-display_errors-off --php_version=php7.0  关闭错误展示

    ```
7. php cli 的版本切换

    ```
    envoy run task-php-change-version --php_version=php7.0

    ```

### 3. 项目远程部署

[](#3-项目远程部署)

1. 简单的克隆项目 (待续)
2. 其他的请根据实际进行自定义 envoy 命令

    - 包括git 拉去代码
    - 包括 持续部署

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Unknown

Total

1

Last Release

2743d ago

### Community

Maintainers

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

---

Top Contributors

[![melodywen](https://avatars.githubusercontent.com/u/17642785?v=4)](https://github.com/melodywen "melodywen (33 commits)")

### Embed Badge

![Health badge](/badges/melody-wen-laravel-envoy/health.svg)

```
[![Health](https://phpackages.com/badges/melody-wen-laravel-envoy/health.svg)](https://phpackages.com/packages/melody-wen-laravel-envoy)
```

###  Alternatives

[deployer/deployer

Deployment Tool

11.0k25.4M207](/packages/deployer-deployer)[appwrite/server-ce

End to end backend server for frontend and mobile apps.

55.3k84.2k](/packages/appwrite-server-ce)[pragmarx/health

Laravel Server &amp; App Health Monitor and Notifier

2.0k1.0M2](/packages/pragmarx-health)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[heroku/heroku-buildpack-php

Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP and Apache2/Nginx as on Heroku

8161.3M10](/packages/heroku-heroku-buildpack-php)[tiamo/phpas2

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

4674.7k](/packages/tiamo-phpas2)

PHPackages © 2026

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