PHPackages                             juzaweb/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. juzaweb/laravel-selfupdater

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

juzaweb/laravel-selfupdater
===========================

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

3.3.2(4y ago)0452MITPHPPHP ^7.4 || ^8.0 || ^8.1

Since Aug 10Pushed 4y agoCompare

[ Source](https://github.com/juzaweb/laravel-selfupdater)[ Packagist](https://packagist.org/packages/juzaweb/laravel-selfupdater)[ GitHub Sponsors](https://github.com/codedge)[ RSS](/packages/juzaweb-laravel-selfupdater/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (2)Dependencies (9)Versions (42)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)[![](https://github.com/codedge/laravel-selfupdater/workflows/Tests/badge.svg)](https://github.com/codedge/laravel-selfupdater/actions)[![StyleCI](https://camo.githubusercontent.com/9a26ffe2e45ef08d73c7c4a8c444b54108ff7429e8019c89a0493c8d225fc6de/68747470733a2f2f7374796c6563692e696f2f7265706f732f36343436333934382f736869656c64)](https://styleci.io/repos/64463948)[![Codacy Badge](https://camo.githubusercontent.com/ab2c17b1951e0e8528fac7e971a67819711c0cbc1ea6e5dec03406d6d1287f60/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6464383336653538363536623465323562333462326134616338313937313432)](https://www.codacy.com/app/codedge/laravel-selfupdater?utm_source=github.com&utm_medium=referral&utm_content=codedge/laravel-selfupdater)[![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 without [Composer](https://getcomposer.org/).

Install
-------

[](#install)

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

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

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.

### ℹ️ Setting the currently installed version

[](#information_source-setting-the-currently-installed-version)

Before starting an update, make sure to set the version installed correctly. You're responsible to set the current version installed, either in the config file or better via the env variable `SELF_UPDATER_VERSION_INSTALLED`.

#### `tag`-based updates

[](#tag-based-updates)

Set the installed version to one of the tags set for a release.

#### `branch`-based updates

[](#branch-based-updates)

Set the installed version to to a datetime of one of the latest commits.
A valid version would be: `2020-04-19T22:35:48Z`

### 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.
            ]
        ]
    ]
]
```

### Configure the download path

[](#configure-the-download-path)

Sometimes your web host does not allow saving files into the `/tmp` folder of the server. You can change the folder the application is downloaded to by setting the env var `SELF_UPDATER_DOWNLOAD_PATH` to something different. Just keep in mind, that the folder is not inside the folder your application lives in as it might be overwritten during the update.

### 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 email### Private repositories

[](#private-repositories)

Private repositories can be accessed via (Bearer) tokens. Each repository inside the config file should have a `private_access_token` field, where you can set the token.

**Note:** Do not prefix the token with `Bearer `. This is done automatically.

Usage
-----

[](#usage)

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

```
Route::get('/', function (\Codedge\Updater\UpdaterManager $updater) {

    // Check if new version is available
    if($updater->source()->isNewVersionAvailable()) {

        // Get the current installed version
        echo $updater->source()->getVersionInstalled();

        // Get the new version available
        $versionAvailable = $updater->source()->getVersionAvailable();

        // Create a release
        $release = $updater->source()->fetch($versionAvailable);

        // Run the update process
        $updater->source()->update($release);

    } else {
        echo "No new version available.";
    }

});
```

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.

#### Tag-based updates

[](#tag-based-updates-1)

This is the default. Updates will be fetched by using a tagged commit, aka release.

#### Branch-based updates

[](#branch-based-updates-1)

Select the branch that should be used via the `use_branch` setting [inside the configuration](https://github.com/codedge/laravel-selfupdater/blob/master/config/self-update.php).

```
// ...
'repository_types' => [
    'github' => [
        'type' => 'github',
        'repository_vendor' => env('SELF_UPDATER_REPO_VENDOR', ''),
        'repository_name' => env('SELF_UPDATER_REPO_NAME', ''),
        // ...
        'use_branch' => 'v2',
   ],
   // ...
];
```

### Using Http archives

[](#using-http-archives)

The package comes with an *Http* source repository type to fetch releases from an HTTP directory listing containing zip archives.

To run with HTTP archives, use following settings in your `.env` file:

Config nameValue / DescriptionSELF\_UPDATER\_SOURCE`http`SELF\_UPDATER\_REPO\_URLArchive URL, e.g. `http://archive.webapp/`SELF\_UPDATER\_PKG\_FILENAME\_FORMATZip package filename formatSELF\_UPDATER\_DOWNLOAD\_PATHDownload path on the webapp host serverThe archive URL should contain nothing more than a simple directory listing with corresponding zip-Archives.

`SELF_UPDATER_PKG_FILENAME_FORMAT` contains the filename format for all webapp update packages. I.e. when the update packages listed on the archive URL contain names like `webapp-v1.2.0.zip`, `webapp-v1.3.5.zip`, ... then the format should be `webapp-v_VERSION_`. The `_VERSION_` part is used as semantic versionioning variable for `MAJOR.MINOR.PATCH` versioning. The zip-extension is automatically added.

The target archive files must be zip archives and should contain all files on root level, not within an additional folder named like the archive itself.

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

[](#contributing)

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

Licence
-------

[](#licence)

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

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 62.5% 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 ~54 days

Recently: every ~93 days

Total

39

Last Release

1506d ago

Major Versions

1.5.0 → 2.0.02019-04-05

2.6.1 → 3.02020-04-17

PHP version history (9 changes)1.0PHP &gt;=5.6

1.1PHP &gt;=7.0

1.4.0PHP &gt;=5.5

2.0.0PHP &gt;=7.1

2.3.0PHP &gt;=7.2

2.6.0PHP &gt;=7.3

3.2PHP ^7.3|^7.4|^8.0

3.2.2PHP ^7.3 || ^7.4 || ^8.0

3.3PHP ^7.4 || ^8.0 || ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/3169e8a8781068840e9300a57785089da521287dbe0279fc9cc7e8de1c1d95a9?d=identicon)[juzaweb](/maintainers/juzaweb)

---

Top Contributors

[![codedge](https://avatars.githubusercontent.com/u/4409904?v=4)](https://github.com/codedge "codedge (300 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (169 commits)")[![juzaweb](https://avatars.githubusercontent.com/u/47020363?v=4)](https://github.com/juzaweb "juzaweb (3 commits)")[![paumove](https://avatars.githubusercontent.com/u/6697842?v=4)](https://github.com/paumove "paumove (2 commits)")[![turbo124](https://avatars.githubusercontent.com/u/5827962?v=4)](https://github.com/turbo124 "turbo124 (2 commits)")[![vortechron](https://avatars.githubusercontent.com/u/22893960?v=4)](https://github.com/vortechron "vortechron (2 commits)")[![jbalatero](https://avatars.githubusercontent.com/u/3615746?v=4)](https://github.com/jbalatero "jbalatero (1 commits)")[![hsyir](https://avatars.githubusercontent.com/u/3897547?v=4)](https://github.com/hsyir "hsyir (1 commits)")

---

Tags

laravelupdateauto-updateself-updatelaravel applicationself-hosted laravel application

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[backpack/basset

Dead-simple way to load CSS or JS assets only once per page, when using Laravel 10+.

202832.4k6](/packages/backpack-basset)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[nickurt/laravel-akismet

Akismet for Laravel 11.x/12.x/13.x

97139.6k2](/packages/nickurt-laravel-akismet)[nickurt/laravel-stopforumspam

StopForumSpam for Laravel 11.x/12.x/13.x

6953.9k](/packages/nickurt-laravel-stopforumspam)

PHPackages © 2026

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