PHPackages                             jafarakhondali/laravel-hooker-gitlab - 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. [API Development](/categories/api)
4. /
5. jafarakhondali/laravel-hooker-gitlab

AbandonedArchivedLibrary[API Development](/categories/api)

jafarakhondali/laravel-hooker-gitlab
====================================

Easy Github and GitLab Webhook deployer for Laravel

116PHP

Since Apr 30Pushed 8y ago1 watchersCompare

[ Source](https://github.com/JafarAkhondali/laravel-hooker-gitlab)[ Packagist](https://packagist.org/packages/jafarakhondali/laravel-hooker-gitlab)[ RSS](/packages/jafarakhondali-laravel-hooker-gitlab/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Deployments Laravel projects using Git webhooks
===============================================

[](#deployments-laravel-projects-using-git-webhooks)

git-deploy-laravel assists deployment by receiving a push event message from your repository's server and automatically pulling project code.

This should work out-of-the-box with Laravel 5.x using with webhooks from GitHub and GitLab servers.

This is an internal tool to help with our common workflow pattern but please feel free to borrow, change and improve.

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

[](#installation)

### Step 1

[](#step-1)

Add the following to your `composer.json` file then update your composer as normal:

```
{
    "require" : {
        "jafarakhondali/git-deploy-laravel" : "dev-master"
    }
}

```

Or run:

```
composer require jafarakhondali/git-deploy-laravel

```

### Step 2

[](#step-2)

Add the following line to you providers in `config/app.php`:

```
jafarakhondali\GitDeploy\GitDeployServiceProvider::class,

```

\*\* New in Laravel 5.5 - Service provide should be automatically detected without the above change \*\*

### Step 3

[](#step-3)

Add the */git-deploy* route to CSRF exceptions so your repo's host can send messages to your project.

In file in `app/Http/Middleware/VerifyCsrfToken.php` add:

```
protected $except = [
    'git-deploy',
];

```

Usage
-----

[](#usage)

Add a webhook for  to your project in GitHub/GitLab and this package will take care of the rest. The webhook should fire on push-events.

Your website will automatically receive POST messages from the repo manager and perform a Git pull.

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

[](#configuration)

In most cases the package will find the correct Git repository and Git executable but we advise publishing our config anyway because it will let you enable extra security options and email notifications.

To add custom configuration run:

```
php artisan vendor:publish --provider="jafarakhondali\GitDeploy\GitDeployServiceProvider"

```

Then edit `/config/gitdeploy.php` to suit your needs.

```
