Download the PHP package tomaszboloz/laravel-updater without Composer

On this page you can find all versions of the php package tomaszboloz/laravel-updater. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-updater

Laravel Updater

CI Latest release

Laravel Updater keeps a Laravel application up to date from the Filament admin panel or Artisan:

It monitors everything automatically on a schedule, shows the number of available updates in the navigation badge, and has a manual Check for updates button.

When a newer application release appears, one click (or one command) runs the whole deployment:

  1. takes a lock, so only one update runs at a time;
  2. puts the site into maintenance mode (with an optional bypass secret);
  3. installs the new code: git fetch + checkout of the release tag, or the release zipball on hosts without git;
  4. runs your steps: composer install, php artisan migrate --force, npm ci, npm run build, php artisan optimize:clear, php artisan optimize, php artisan queue:restart (all configurable);
  5. remembers the installed version and brings the site back up.

If any step fails, the code is rolled back to the previous commit, the recovery steps run (composer install, optimize:clear), the site goes back up and the error is shown in the panel.

Packages

The Installed packages table lists every direct dependency from composer.json (with dev and private badges), the installed version and the latest one found by the last check:

If a step fails, composer.lock is restored and composer install brings vendor/ back to the previous state. Only installed direct dependencies can be updated: package names from the browser are checked against them.

Private packages

Updates → Settings → Private packages holds any number of private Composer packages hosted on GitHub: Composer name, owner/repository and a token (fine-grained, Contents: Read-only). Tokens are encrypted and never sent back to the browser; an empty field keeps the saved token.

Private packages are monitored by their tags. During updates every repository gets its own token: git receives a per-repository http.<url>.extraheader, Composer receives COMPOSER_AUTH, all through the environment, never through process arguments. The packages still need their repositories entry ("type": "vcs") in composer.json, as usual for private packages.

Monitoring

updater:check checks the application release and all packages in one go (composer outdated --direct plus GitHub tags of private packages). It runs:

When something newer is found, UpdatesAvailable is dispatched (listen to it for e-mail or Slack notifications), and the navigation badge shows the count.

Use cases

Requirements

Installation

Settings: in the admin panel

Open Updates → Settings in the Filament panel and fill in:

Panel settings are saved in storage/app/updater/settings.json (permissions 0600, secrets encrypted) and take precedence over config and .env. Without Filament, or as defaults before the first save, the same values can come from .env:

Update steps (the commands that run) are configured only in config/updater.php, on purpose: letting panel users define commands would let them run arbitrary code on the server.

Settings are encrypted with APP_KEY. If you rotate the key, enter the token again.

Private repositories

Create a fine-grained personal access token limited to the one repository, with Repository permissions → Contents: Read-only, and save it in Updates → Settings. Public repositories need no token, but a token raises GitHub's API rate limit.

Who may update: the gate

The admin page and its actions require the updater.manage ability, so nobody can update until you allow it (secure by default). Define the gate, for example in AppServiceProvider::boot():

Change the ability name with the updater.ability config option.

With Filament Shield the gate is not needed: the Updates page appears in Shield's role editor (Pages tab) and its permission (View:UpdaterPage with Shield's default key format) decides who may open it, poll the progress and start updates. Run php artisan shield:generate --all --panel=admin once to create the permission, then grant it to roles. If Shield excludes the page (filament-shield.pages.exclude) or you set updater.shield to false, the gate above applies again. Without Shield installed nothing changes.

Filament admin panel

Register the plugin in your panel provider:

The Updates page shows the installed and latest version, the release notes (rendered as escaped Markdown), a Settings button, a Check for updates button and an Update now button with confirmation. While an update runs, the page refreshes every five seconds and shows the live log.

The plugin follows the Filament 5 plugin conventions: make() resolves it from the container, get() returns the instance registered on the current panel, and the service provider extends Spatie's PackageServiceProvider.

Everything runs in the background

Buttons in the panel never run Composer, npm or migrations inside the web request. They start a task and return:

What keeps the site and the panel working while an update runs:

Artisan

To update automatically every night:

Configuration

Options marked panel are edited in Updates → Settings; config and .env are their fallback.

Option Default Description
repository (panel) UPDATER_REPOSITORY owner/repository that publishes the releases
token (panel) UPDATER_GITHUB_TOKEN Token for private repositories, stored encrypted
strategy (panel) git git (checkout of the tag, with rollback) or archive (zipball, no rollback)
current_version (panel) 0.0.0 Version before the first update; later stored in storage/app/updater/version
ability updater.manage Gate ability for the admin page
shield true Use the Filament Shield page permission instead of the ability (when Shield is installed)
check_cache_minutes 10 How long the latest release and tags are cached
schedule 0 */6 * * * Cron expression of the automatic check, null turns it off
package_steps composer update {packages}, migrate, caches Commands of a package update; {packages} is the package or nothing for all
package_recovery_steps composer install, optimize:clear Commands run after composer.lock has been restored
git_ignored_changes composer.lock Tracked files whose local changes do not block an application update
timeout 900 Seconds allowed for each step
maintenance (panel) enabled, retry 60 Maintenance mode during the update, with an optional bypass secret
binaries php, composer, npm, git Binaries behind @php, @composer, @npm, @git; e.g. "php8.3 /usr/local/bin/composer"
environment HOME, COMPOSER_HOME Extra environment variables; workers often lack HOME
steps see below Commands run after the new code is in place
recovery_steps composer install, optimize:clear Commands run after a rollback
preserve .env, storage, vendor... Paths the archive strategy never overwrites
runner process process (detached updater:work) or queue (RunTask job)
route_prefix updater Prefix of the progress endpoint polled by the page
route_middleware ['web', 'auth'] Middleware of that endpoint; use the panel's guard, e.g. auth:admin
queue default connection connection, name and timeout of the RunTask job
cache_store default store Cache for GitHub API answers

Steps are arrays of arguments and are never passed through a shell:

Remove the npm steps if your app has no front-end build, and add anything your deployment needs.

--no-dev is dropped from Composer commands when the application was installed with dev packages (vendor/composer/installed.json says so), so running an update on a development machine does not remove tools such as PHPUnit, Pint or debug bars. Production installs (composer install --no-dev) stay without them.

Update strategies

git (default). The application directory is a clone of the repository with an origin remote. The updater refuses to run when tracked files have local changes, fetches only the release tag, checks it out and keeps the previous commit as a restore point. If a step fails, it checks the previous commit out again.

archive. For hosts without git. The release zipball is downloaded from the GitHub API, checked for unsafe paths and copied over the application, skipping the preserve paths. Files a release no longer ships are deleted on the next update (from the first archive update on; other files are never touched). There is no automatic rollback, so keep backups.

Events

Event When
TomaszBoloz\LaravelUpdater\Events\UpdateSucceeded The release is installed ($event->release)
TomaszBoloz\LaravelUpdater\Events\UpdateFailed The update failed ($event->release, $event->exception)
TomaszBoloz\LaravelUpdater\Events\UpdatesAvailable A check found updates ($event->release, $event->packages)
TomaszBoloz\LaravelUpdater\Events\PackagesUpdated Packages updated ($event->package, null = all)
TomaszBoloz\LaravelUpdater\Events\PackagesUpdateFailed A package update failed ($event->package, $event->exception)

Listen to them to send notifications, for example to Slack or e-mail.

Security

Migrations are not rolled back automatically. Write backward-compatible migrations and back up the database, for example with a backup:run step before migrate.

Report vulnerabilities privately as described in SECURITY.md.

Testing

Releases

Every push to main that passes CI is tagged automatically from Conventional Commits: fix: → patch, feat: → minor, feat!: or BREAKING CHANGE: → major. A GitHub release with notes is created for each tag.

Author

Tomasz Bołoz · www.damtox.pl

License

The MIT License (MIT). See LICENSE.md.


All versions of laravel-updater with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/cache Version ^12.0|^13.0
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/process Version ^12.0|^13.0
illuminate/queue Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
spatie/laravel-package-tools Version ^1.92
symfony/process Version ^7.2|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tomaszboloz/laravel-updater contains the following files

Loading the files please wait ...