Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Updater Laravel Package

salahhusa9/laravel-updater

Update your Laravel 10/11/12 app with a single command or click. Laravel Updater streamlines project updates with an easy setup and docs, plus built-in tests and ongoing maintenance for smoother upgrades.

View on GitHub
Deep Wiki
Context7

Getting Started

Install the package via Composer:

composer require salahhusa9/laravel-updater

No service provider or config publishing is required — the package auto-registers. Run php artisan list and look for updater:check and updater:update. The simplest first use is to check for updates:

php artisan updater:check

This will scan your app’s git repository (or configured source) and report if a newer version is available. To perform an actual update:

php artisan updater:update

The command performs a git fetch, git checkout, and runs Composer install by default — ideal for development and staging environments.

Implementation Patterns

  • CI/CD Integration: Use the updater:update command in your deployment pipeline (e.g., GitHub Actions, Deployer) after pulling the latest code to ensure dependencies are fresh and migrations are applied if needed. Example:

    php artisan updater:update --force
    

    The --force flag bypasses confirm prompts for non-interactive environments.

  • Before/After Hooks: Define custom pipeline steps via configuration or event listeners. The package merges custom beforeUpdate() and afterUpdate() pipelines with built-in steps (e.g., composer install, migrate, config:cache). Configure via config/updater.php or environment variables:

    UPDATER_BEFORE=publish,clear-caches
    UPDATER_AFTER=optimize,send-notification
    

    Custom pipelines can be artisan commands or closures registered via the Updater facade.

  • Version Comparison Strategy: Configure how versions are compared (e.g., using tags, branches, or SHA). In config/updater.php, adjust the version_strategy to 'tag', 'branch', or 'sha' to align with your release process.

  • GUI Access (optional): Though not core, many teams wrap updater:check in a simple controller method guarded by app()->isLocal() or role-based middleware for quick manual updates in dev.

Gotchas and Tips

  • Git State Matters: The updater performs a hard reset (git checkout -f). Any local modifications (e.g., .env changes, debug code) will be lost unless excluded via .git/info/exclude or .gitignore. Tip: Always stage or commit local changes before running updates in non-prod environments.

  • No Auto-Migrations by Default: While migrate is in the default afterUpdate pipeline, it only runs if the environment allows it (APP_ENV not in UPDATER_BLOCK_ENVS). Confirm or adjust config/updater.php to avoid unintended production migrations.

  • Security Considerations: The package runs Composer install, which may pull in new dependencies. Audit your composer.json and restrict repository sources using COMPOSER_REPO or private repository auth in the environment.

  • Command Output Verbosity: Use -v, -vv, or -vvv flags to increase detail during debugging (e.g., if Composer install fails silently).

  • Configuration Override: While config/updater.php is published automatically, you can override any setting at runtime:

    config(['updater.force' => true]);
    Artisan::call('updater:update');
    
  • Testing Safely: The package includes a mock git repository helper. In tests, set config('updater.mock', true) to avoid actual git operations during feature tests of your updater pipeline.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport