PHPackages                             kg-bot/laravel-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. kg-bot/laravel-deploy

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

kg-bot/laravel-deploy
=====================

Laravel package used to automatically deploy code from GIT version controls

v3.0(7y ago)7601MITPHPPHP &gt;=7.1

Since Jun 4Pushed 7y ago2 watchersCompare

[ Source](https://github.com/kg-bot/laravel-deploy)[ Packagist](https://packagist.org/packages/kg-bot/laravel-deploy)[ RSS](/packages/kg-bot-laravel-deploy/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (4)Versions (5)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/419618aaed783d1bff7b13cb8264cef6426c99e6ea9df8d82d0116918ccceefe/68747470733a2f2f706f7365722e707567782e6f72672f6b672d626f742f6c61726176656c2d6465706c6f792f762f737461626c65)](https://packagist.org/packages/kg-bot/laravel-deploy)[![Total Downloads](https://camo.githubusercontent.com/507e0b99e90ba5efff89e37b0a9931ac41762cbdb7a650c8a1077d3a624c6a4d/68747470733a2f2f706f7365722e707567782e6f72672f6b672d626f742f6c61726176656c2d6465706c6f792f646f776e6c6f616473)](https://packagist.org/packages/kg-bot/laravel-deploy)[![Latest Unstable Version](https://camo.githubusercontent.com/0e92daaa2a447aabda74e9accaaf393ccf705b1aa13b3409b6f6b82def85e23a/68747470733a2f2f706f7365722e707567782e6f72672f6b672d626f742f6c61726176656c2d6465706c6f792f762f756e737461626c65)](https://packagist.org/packages/kg-bot/laravel-deploy)[![License](https://camo.githubusercontent.com/6f0710eeaa4c2b8d9ab5e5e43ff9c2803ebbe1057ccc3c85c6c70c7262afa58e/68747470733a2f2f706f7365722e707567782e6f72672f6b672d626f742f6c61726176656c2d6465706c6f792f6c6963656e7365)](https://packagist.org/packages/kg-bot/laravel-deploy)[![Monthly Downloads](https://camo.githubusercontent.com/ecb0ec25298c6458a637acb0751ef8c8351da5c26b56b67d610424ac0ff2ab1d/68747470733a2f2f706f7365722e707567782e6f72672f6b672d626f742f6c61726176656c2d6465706c6f792f642f6d6f6e74686c79)](https://packagist.org/packages/kg-bot/laravel-deploy)[![Daily Downloads](https://camo.githubusercontent.com/5a0dabe4fe8b295d58327fa6885ffbaa063a848c0dcd6dfb5315dcec5b1804ed/68747470733a2f2f706f7365722e707567782e6f72672f6b672d626f742f6c61726176656c2d6465706c6f792f642f6461696c79)](https://packagist.org/packages/kg-bot/laravel-deploy)

Laravel Deploy
==============

[](#laravel-deploy)

Laravel deploy package, used to automatically deploy project from GIT VCS that supports webhooks.

Installing
----------

[](#installing)

Just require this package with composer.

```
composer require kg-bot/laravel-deploy

```

Before you can use this package you have to export and run migrations and create clients for each VCS site or repository

```
php artisan vendor:publish --provider=KgBot\LaravelDeploy\LaravelDeployServiceProvider --tag=migrations
php artisan migrate

```

You can create new client with artisan command (Web panel should be in next release)

```
php artisan laravel-deploy:new-client {name} {token} {script_source} {source}

```

#### Explanation of command parameters

[](#explanation-of-command-parameters)

- `name` - Name of the client (eg. GitHub)
- `token` - Token you want to check when validating request, it will be encrypted
- `script_source` - Name of the .sh script that will be executed on deploy request ( this script needs to be placed in project root )
- `source` - Can be anything and might be used in later versions of app, preferably set this to domain from where you expect request or repository URL

Because deploy is initiated from HTTP request user executing .sh script would be www-data and I find it cumbersome for non Linux or Server oriented developers to tweak with user permissions and server privileges.

This can be changed with some .env directives, you should create .sh script with your default server user and set rwx permissions for that user.

Next thing you need to do is add `LARAVEL_DEPLOY_USERNAME` to .env file and set it to your default user (same user from your SSH/CLI).

Also you need to set `LARAVEL_DEPLOY_PASSWORD` .env directive to match your default SSH/CLI login password.

##### Example

[](#example)

If you login to your server with `ssh forge@123.213.65.1` and you enter `temp123` as your password then you would set `LARAVEL_DEPLOY_USERNAME=forge` and `LARAVEL_DEPLOY_PASSWORD=temp123` inside .env file.

Laravel Deploy is enabled by default, if you want to disable it add `LARAVEL_DEPLOY_RUN=false` to your .env file.

### Laravel 5.5+

[](#laravel-55)

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

```
KgBot\LaravelDeploy\LaravelDeployServiceProvider::class

```

Settings and configuration
--------------------------

[](#settings-and-configuration)

You can export config by running

```
php artisan vendor:publish --provide=KgBot\LaravelDeploy\LaravelDeployServiceProvider --tag=config

```

We have already explained some of this package config directives but that's not all.

```
