PHPackages                             laravel-enso/upgrade - 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. laravel-enso/upgrade

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

laravel-enso/upgrade
====================

Helper classes dependency for Laravel Enso

2.14.5(2mo ago)137.8k↓17.6%29MITPHPPHP ^8.3CI failing

Since Mar 16Pushed 2mo ago4 watchersCompare

[ Source](https://github.com/laravel-enso/upgrade)[ Packagist](https://packagist.org/packages/laravel-enso/upgrade)[ Docs](https://github.com/laravel-enso/upgrade)[ RSS](/packages/laravel-enso-upgrade/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (11)Versions (79)Used By (9)

Upgrade
=======

[](#upgrade)

[![License](https://camo.githubusercontent.com/fb62196d5628d1b14267a5b15fcac3cbde19b61902d461370d051470212cc7a0/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f757067726164652f6c6963656e7365)](LICENSE)[![Stable](https://camo.githubusercontent.com/d66bd230c388b27f7b8b5579f45d9891fdc9900a79c4a456dcd6bee7f2fa9b25/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f757067726164652f76657273696f6e)](https://packagist.org/packages/laravel-enso/upgrade)[![Downloads](https://camo.githubusercontent.com/cf6e726af26b0db948172a43b8b09c9aa18b695aa32db82d99d5c6067827ef61/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f757067726164652f646f776e6c6f616473)](https://packagist.org/packages/laravel-enso/upgrade)[![PHP](https://camo.githubusercontent.com/76d2504e4f304c14866dd7295641dd6812652d93a1848a27fc8e2a08d6732731/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e332532422d3737376262342e737667)](composer.json)[![Issues](https://camo.githubusercontent.com/4338e257fedc4c8393e0641689c798f91412c138b28251e92d1416a71663a700/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6c61726176656c2d656e736f2f757067726164652e737667)](https://github.com/laravel-enso/upgrade/issues)[![Merge Requests](https://camo.githubusercontent.com/6f1821d7496af7c3257153e0e77cc9edaa3a5cce9427e455868cc8b6d340447c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d70722f6c61726176656c2d656e736f2f757067726164652e737667)](https://github.com/laravel-enso/upgrade/pulls)

Description
-----------

[](#description)

Upgrade orchestrates both package-level upgrade routines across the Laravel Enso ecosystem and local project upgrade routines defined inside the host application.

It discovers upgrade classes from the application and from configured vendor packages, sorts them by priority and last modification date, and executes them through a consistent pipeline that supports table migrations, data migrations, post-data migration steps, rollback hooks, manual-only upgrades, and before-migration upgrades.

The package also includes a structure-upgrade adapter for permission and role provisioning, plus a status command that reports upgrade applicability, execution mode, ordering, and migration state.

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

[](#installation)

This package is normally installed as part of the Enso core stack.

For standalone installation in an Enso-based application:

```
composer require laravel-enso/upgrade
```

The package registers:

- `enso:upgrade`
- `enso:upgrade:status`

If needed, you can publish the config with:

```
php artisan vendor:publish --tag=upgrade-config
```

Default configuration:

```
return [
    'folders' => ['.'],
    'vendors' => ['laravel-enso'],
];
```

Features
--------

[](#features)

- Discovers upgrade classes from local folders and configured vendor namespaces.
- Supports package upgrades implemented as PHP classes instead of one-off scripts.
- Sorts upgrades by explicit priority and then by last modified timestamp.
- Supports pre-migration upgrades through the `BeforeMigration` marker interface.
- Supports manual-only upgrades through the `ShouldRunManually` marker interface.
- Supports conditional execution through the `Applicable` contract.
- Executes table, data, and post-data migration steps in a controlled sequence.
- Rolls back table changes when a data or post-data migration fails and the upgrade implements rollback support.
- Wraps structure upgrades into permission and role synchronization workflows.
- Provides a status table for debugging pending, manual, or already-ran upgrades.

Usage
-----

[](#usage)

Run all applicable upgrades:

```
php artisan enso:upgrade
```

Run manual upgrades as well:

```
php artisan enso:upgrade --manual
```

Run only upgrades meant to execute before the main database migration flow:

```
php artisan enso:upgrade --before-migration
```

Inspect the current upgrade inventory and status:

```
php artisan enso:upgrade:status
```

A minimal upgrade class can implement `MigratesTable`:

```
use Illuminate\Support\Facades\Schema;
use LaravelEnso\Upgrade\Contracts\MigratesTable;

class AddStatusColumn implements MigratesTable
{
    public function isMigrated(): bool
    {
        return Schema::hasColumn('orders', 'status');
    }

    public function migrateTable(): void
    {
        Schema::table('orders', function ($table) {
            $table->string('status')->nullable();
        });
    }
}
```

Structure upgrades can declare permissions and optional roles:

```
use LaravelEnso\Upgrade\Contracts\MigratesStructure;
use LaravelEnso\Upgrade\Traits\StructureMigration;

class OrdersStructureUpgrade implements MigratesStructure
{
    use StructureMigration;

    protected array $permissions = [
        ['name' => 'orders.index', 'description' => 'List orders', 'is_default' => true],
    ];

    protected array $roles = ['admin'];
}
```

::: tip Tip If an upgrade implements `RollbackTableMigration`, the package will automatically call `rollbackTableMigration()` when the data migration or post-data migration phase throws. :::

API
---

[](#api)

### Commands

[](#commands)

- `enso:upgrade {--manual} {--before-migration}`
- `enso:upgrade:status`

### Core Services

[](#core-services)

- `LaravelEnso\Upgrade\Services\Finder`
- `LaravelEnso\Upgrade\Services\Upgrade`
- `LaravelEnso\Upgrade\Services\Database`
- `LaravelEnso\Upgrade\Services\UpgradeStatus`
- `LaravelEnso\Upgrade\Services\Structure`

### Execution Model

[](#execution-model)

The current execution pipeline is split into three phases:

- `migrateTable()`
- `migrateData()`
- `migratePostDataMigration()`

Only the `migrateData()` phase is wrapped in a database transaction.

`migrateTable()` and `migratePostDataMigration()` run outside the transaction boundary. If either the data migration or the post-data migration phase fails, and the upgrade implements `RollbackTableMigration`, the package calls `rollbackTableMigration()` to undo the table changes explicitly.

### Contracts

[](#contracts)

Execution contracts:

- `Upgrade`
- `MigratesTable`
- `MigratesData`
- `MigratesPostDataMigration`
- `RollbackTableMigration`
- `MigratesStructure`

Execution modifiers:

- `Applicable`
- `BeforeMigration`
- `Prioritization`
- `ShouldRunManually`

### Helpers

[](#helpers)

Database inspection helpers:

- `LaravelEnso\Upgrade\Helpers\Table`
- `LaravelEnso\Upgrade\Helpers\Column`

DBAL bridge:

- `LaravelEnso\Upgrade\Services\DBAL\Connection`

### Discovery Rules

[](#discovery-rules)

The finder scans:

- configured vendor folders from `enso.upgrade.vendors`
- configured local folders from `enso.upgrade.folders`
- `Upgrades` namespaces derived from each package's PSR-4 autoload root

### Structure Upgrades

[](#structure-upgrades)

`MigratesStructure` upgrades are wrapped by `LaravelEnso\Upgrade\Services\Structure`, which:

- creates missing permissions
- assigns them to the default role
- assigns non-default permissions only to explicitly listed roles
- can run an additional post-data migration phase

Depends On
----------

[](#depends-on)

Required Enso packages:

- [`laravel-enso/core`](https://docs.laravel-enso.com/backend/core.html) [↗](https://github.com/laravel-enso/core)
- [`laravel-enso/enums`](https://docs.laravel-enso.com/backend/enums.html) [↗](https://github.com/laravel-enso/enums)
- [`laravel-enso/helpers`](https://docs.laravel-enso.com/backend/helpers.html) [↗](https://github.com/laravel-enso/helpers)
- [`laravel-enso/permissions`](https://docs.laravel-enso.com/backend/permissions.html) [↗](https://github.com/laravel-enso/permissions)
- [`laravel-enso/roles`](https://docs.laravel-enso.com/backend/roles.html) [↗](https://github.com/laravel-enso/roles)

External dependencies:

- [`doctrine/dbal`](https://github.com/doctrine/dbal) [↗](https://github.com/doctrine/dbal)

Contributions
-------------

[](#contributions)

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

###  Health Score

61

—

FairBetter than 98% of packages

Maintenance86

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community26

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~38 days

Recently: every ~2 days

Total

59

Last Release

67d ago

Major Versions

1.0.8 → 2.0.02020-06-26

PHP version history (3 changes)1.0.0PHP &gt;=7.4.0

2.3.11PHP &gt;=8.0

2.14.1PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16073274?v=4)[Adrian Ocneanu](/maintainers/aocneanu)[@aocneanu](https://github.com/aocneanu)

---

Top Contributors

[![aocneanu](https://avatars.githubusercontent.com/u/16073274?v=4)](https://github.com/aocneanu "aocneanu (41 commits)")[![vmcvlad](https://avatars.githubusercontent.com/u/37445394?v=4)](https://github.com/vmcvlad "vmcvlad (28 commits)")[![raftx24](https://avatars.githubusercontent.com/u/10864136?v=4)](https://github.com/raftx24 "raftx24 (22 commits)")[![gandesc](https://avatars.githubusercontent.com/u/14071925?v=4)](https://github.com/gandesc "gandesc (21 commits)")[![AbdullahiAbdulkabir](https://avatars.githubusercontent.com/u/33360580?v=4)](https://github.com/AbdullahiAbdulkabir "AbdullahiAbdulkabir (3 commits)")[![GITmanuela](https://avatars.githubusercontent.com/u/44998004?v=4)](https://github.com/GITmanuela "GITmanuela (2 commits)")

---

Tags

upgradelaravel-enso

### Embed Badge

![Health badge](/badges/laravel-enso-upgrade/health.svg)

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

###  Alternatives

[laravel-enso/tables

Server-side data tables and export backend for Laravel Enso

63355.1k84](/packages/laravel-enso-tables)[laravel-enso/tutorials

Tutorial management backend for Laravel Enso

1140.7k](/packages/laravel-enso-tutorials)[laravel-enso/forms

JSON-based form builder for Laravel Enso

12354.2k85](/packages/laravel-enso-forms)[laravel-enso/data-import

Excel Importer dependency for Laravel Enso

2044.0k6](/packages/laravel-enso-data-import)[laravel-enso/permissions

Permission management for Laravel Enso

1244.2k52](/packages/laravel-enso-permissions)[laravel-enso/roles

Role management for Laravel Enso

1044.9k32](/packages/laravel-enso-roles)

PHPackages © 2026

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