PHPackages                             andrew-a/laravel-selfupdater - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. andrew-a/laravel-selfupdater

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

andrew-a/laravel-selfupdater
============================

Providing an auto-updating functionality for your self-hosted Laravel application.

0120PHP

Since Jul 5Pushed 7y ago1 watchersCompare

[ Source](https://github.com/AndrewAubury/laravel-selfupdater)[ Packagist](https://packagist.org/packages/andrew-a/laravel-selfupdater)[ RSS](/packages/andrew-a-laravel-selfupdater/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Application Self-Updater
================================

[](#laravel-application-self-updater)

[![Latest Stable Version](https://camo.githubusercontent.com/e6fc6bba685acaac38ec721263953c6fba75e217d2c2e9bd61888a84a6de9846/68747470733a2f2f706f7365722e707567782e6f72672f636f64656467652f6c61726176656c2d73656c66757064617465722f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/codedge/laravel-selfupdater)[![Total Downloads](https://camo.githubusercontent.com/fc877aea94c6037e17ce6a9c141e9e82c05ecc8b5a09badfa20c2af22799909a/68747470733a2f2f706f7365722e707567782e6f72672f636f64656467652f6c61726176656c2d73656c66757064617465722f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/codedge/laravel-selfupdater)[![Build Status](https://camo.githubusercontent.com/e6b2ec08a3f6dc26ddffdbf0cf5553023c1e4ce37e078faf86bae89fd2a0af76/68747470733a2f2f7472617669732d63692e6f72672f636f64656467652f6c61726176656c2d73656c66757064617465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/codedge/laravel-selfupdater)[![StyleCI](https://camo.githubusercontent.com/9a26ffe2e45ef08d73c7c4a8c444b54108ff7429e8019c89a0493c8d225fc6de/68747470733a2f2f7374796c6563692e696f2f7265706f732f36343436333934382f736869656c64)](https://styleci.io/repos/64463948)[![codecov](https://camo.githubusercontent.com/0f8f2bcbe84923cae5f9183549a4f58339a541681de598564935474281422964/68747470733a2f2f636f6465636f762e696f2f67682f636f64656467652f6c61726176656c2d73656c66757064617465722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/codedge/laravel-selfupdater)

This package provides some basic methods to implement a self updating functionality for your Laravel 5 application. Already bundled are some methods to provide a self-update mechanism via Github.

Usually you need this when distributing a self-hosted Laravel application that needs some updating mechanism, as you do not want to bother your lovely users with Git and/or Composer commands ;-)

Install with Composer
---------------------

[](#install-with-composer)

There are currently two branches:

- `master`: Compatible with PHP 7.x
- `5.x`: Compatible with PHP 5.5 + 5.6

*Please select the right branch for your PHP version accordingly.*

To install the latest version from the master using [Composer](https://getcomposer.org/):

```
$ composer require codedge/laravel-selfupdater
```

This adds the *codedge/laravel-selfupdater* package to your `composer.json` and downloads the project.

You need to include the service provider in your `config/app.php` `[1]` and optionally the *facade* `[2]`:

```
// config/app.php

return [

    //...

    'providers' => [
        // ...

        Codedge\Updater\UpdaterServiceProvider::class, // [1]
    ],

    // ...

    'aliases' => [
        // ...

        'Updater' => Codedge\Updater\UpdaterManager::class, // [2]

]
```

Additionally add the listener to your `app/Providers/EventServiceProvider.php`:

```
// app/Providers/EventServiceProvider.php

/**
 * The event handler mappings for the application.
 *
 * @var array
 */
protected $listen = [
    // ...

    \Codedge\Updater\Events\UpdateAvailable::class => [
        \Codedge\Updater\Listeners\SendUpdateAvailableNotification::class
    ],
    \Codedge\Updater\Events\UpdateSucceeded::class => [
        \Codedge\Updater\Listeners\SendUpdateSucceededNotification::class
    ],

];
```

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

[](#configuration)

After installing the package you need to publish the configuration file via

```
$ php artisan vendor:publish --provider="Codedge\Updater\UpdaterServiceProvider"
```

**Note:** Please enter correct value for vendor and repository name in your `config/self-updater.php` if you want to use Github as source for your updates.

### Running artisan commands

[](#running-artisan-commands)

Artisan commands can be run before or after the update process and can be configured in `config/self-updater.php`:

**Example:**

```
'artisan_commands' => [
    'pre_update' => [
        'updater:prepare' => [
            'class' => \App\Console\Commands\PreUpdateTasks::class,
            'params' => []
        ],
    ],
    'post_update' => [
        'postupdate:cleanup' => [
            'class' => \App\Console\Commands\PostUpdateCleanup::class,
            'params' => [
                'log' => 1,
                'reset' => false,
                // etc.
            ]
        ]
    ]
]
```

### Notifications via email

[](#notifications-via-email)

You need to specify a recipient email address and a recipient name to receive update available notifications. You can specify these values by adding `SELF_UPDATER_MAILTO_NAME` and `SELF_UPDATER_MAILTO_ADDRESS` to your `.env` file.

Config nameDescriptionSELF\_UPDATER\_MAILTO\_NAMEName of email recipientSELF\_UPDATER\_MAILTO\_ADDRESSAddress of email recipientSELF\_UPDATER\_MAILTO\_UPDATE\_AVAILABLE\_SUBJECTSubject of update available emailSELF\_UPDATER\_MAILTO\_UPDATE\_SUCCEEDED\_SUBJECTSubject of update succeeded emailUsage
-----

[](#usage)

To start an update process, i. e. in a controller, just use:

```
public function update()
{
    // This downloads and install the latest version of your repo
    Updater::update();

    // Just download the source and do the actual update elsewhere
    Updater::fetch();

    // Check if a new version is available and pass current version
    Updater::isNewVersionAvailable('1.2');
}
```

Of course you can inject the *updater* via method injection:

```
public function update(UpdaterManager $updater)
{

    $updater->update(); // Same as above

    // .. and shorthand for this:
    $updater->source()->update;

    $updater->fetch() // Same as above...
}
```

**Note:** Currently the fetching of the source is a *synchronous* process. It is not run in background.

### Using Github

[](#using-github)

The package comes with a *Github* source repository type to fetch releases from Github - basically use Github to pull the latest version of your software.

Just make sure you set the proper repository in your `config/self-updater.php`file.

Extending and adding new source repository types
------------------------------------------------

[](#extending-and-adding-new-source-repository-types)

You want to pull your new versions from elsewhere? Feel free to create your own source repository type somewhere but keep in mind for the new source repository type:

- It *needs to* extend **AbstractRepositoryType**
- It *needs to* implement **SourceRepositoryTypeContract**

So the perfect class head looks like

```
class BitbucketRepositoryType extends AbstractRepositoryType implements SourceRepositoryTypeContract

```

Afterwards you may create your own [service provider](https://laravel.com/docs/5.2/providers), i. e. BitbucketUpdaterServiceProvider, with your boot method like so:

```
public function boot()
{
    Updater::extend('bitbucket', function($app) {
        return Updater::sourceRepository(new BitbucketRepositoryType);
    });
}
```

Now you call your own update source with:

```
public function update(UpdaterManager $updater)
{
    $updater->source('bitbucket')->update();
}
```

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

[](#contributing)

Please see the [contributing guide](CONTRIBUTING.md).

Roadmap
-------

[](#roadmap)

Just a quickly sketched [roadmap](https://github.com/codedge/laravel-selfupdater/wiki/Roadmap) what still needs to be implemented.

Licence
-------

[](#licence)

The MIT License (MIT). Please see [Licencse file](LICENSE) for more information.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17990383?v=4)[Andrew Aubury](/maintainers/AndrewAubury)[@AndrewAubury](https://github.com/AndrewAubury)

---

Top Contributors

[![AndrewAubury](https://avatars.githubusercontent.com/u/17990383?v=4)](https://github.com/AndrewAubury "AndrewAubury (2 commits)")

### Embed Badge

![Health badge](/badges/andrew-a-laravel-selfupdater/health.svg)

```
[![Health](https://phpackages.com/badges/andrew-a-laravel-selfupdater/health.svg)](https://phpackages.com/packages/andrew-a-laravel-selfupdater)
```

PHPackages © 2026

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