Satellites (subscriptions, shipping labels, gift cards, …) install with the
usual composer require + php artisan vendor:publish + php artisan migrate.
Uninstalling is a first-class engine command that preserves data by
default, so reinstalling later picks up where the store left off. Dropping a
satellite's tables is an explicit --purge.
See parent plan §16.6 and engine spec §3.32 / §5 row 16.
Requirements on every satellite
-
Register with the
SatelliteRegistryin your service provider'sboot(), and guard your wiring on the result:use ArtisanPackUI\Ecommerce\Registries\SatelliteRegistry; public function boot(): void { $active = $this->app->make( SatelliteRegistry::class )->register( [ 'package_name' => 'acme/ecommerce-subscriptions', 'version' => '1.2.0', 'label' => __( 'Subscriptions' ), 'migration_paths' => [ __DIR__ . '/../database/migrations' ], 'config_keys' => [ 'ecommerce-subscriptions' ], 'meta_namespaces' => [ 'orders.meta.subscription', 'cart.meta.subscription' ], 'tables' => [ 'subscriptions', 'subscription_cycles' ], 'columns' => [ 'orders' => [ 'subscription_id' ] ], 'product_types' => [ 'subscription' ], 'uninstaller' => SubscriptionsUninstaller::class, ] ); if ( ! $active ) { return; // Uninstalled: register no routes, config, bindings, or hooks. } // …routes, config, product types, listeners, scheduled jobs… }register()only keeps the descriptor in memory — nothing is written per request. Theecommerce:satellite:*commands persist it to theecommerce_satellitestable (SatelliteRegistry::sync()). Registering the same package twice replaces the first descriptor; it throws inlocal/testingand logs a warning elsewhere. When a synced satellite'sversionchanges, its recorded verification hash is cleared (see satellite-verification.md).Key Meaning package_nameComposer name ( vendor/package). Required, unique.versionInstalled version. Required. labelDisplay name. migration_pathsDirectories holding only your migrations (absolute, or relative to the app base path). Used by --purge. A path that is, or contains, the app'sdatabase/migrationsdirectory, the engine's migrations, or the app base path is refused —--purgerolls back every ran migration under the given paths. A dedicated sub-directory such asdatabase/migrations/my-satelliteis fine.config_keysConfig files / keys you publish. meta_namespacesorders.meta/cart.metanamespaces you own.tablesTables you create. columnsColumns you add to tables you don't own, keyed by table. product_typesProduct type keys you register. uninstallerClass implementing ArtisanPackUI\Ecommerce\Contracts\SatelliteUninstaller. -
Ship full
up()anddown()migrations for every table and column.down()must be idempotent (Schema::dropIfExists,hasColumnguards) and safe on any prior schema version —--purgeruns it. -
Ship a
SatelliteUninstallerwhen you own long-lived services. A satellite that declares none gets the engine's no-opNullSatelliteUninstaller. So does one whose class no longer exists or doesn't implement the contract (for example, aftercomposer remove); the uninstall command then warns that it is skipping service teardown.use ArtisanPackUI\Ecommerce\Contracts\SatelliteUninstaller; use ArtisanPackUI\Ecommerce\Satellites\SatelliteDescriptor; final class SubscriptionsUninstaller implements SatelliteUninstaller { public function uninstall( SatelliteDescriptor $satellite, bool $purge ): void { // Cancel remote renewal webhooks, stop queue consumers, forget // cached schedules, … Must be idempotent. Don't drop tables — // with --purge the engine rolls your migrations back afterwards. } }
Active vs. uninstalled
A satellite is active unless ecommerce:satellite:uninstall marked it
uninstalled. An uninstalled satellite stays inactive — even while its package
is still installed — until ecommerce:satellite:reinstall re-attaches it.
register() returns false for it, and SatelliteRegistry::isActive() answers
the same question anywhere else.
The uninstalled set is read from the database once and cached (cache key
artisanpack.ecommerce.satellites.uninstalled); the lifecycle commands bust the
cache. Before the ecommerce_satellites table exists, or when the database is
unreachable, every satellite counts as active.
As a safety net, the product types an inactive satellite declares are removed
from the ProductTypeRegistry once the app has booted, even if the satellite
registered them without checking register()'s result. Account and admin menu
entries that name the satellite in their satellite key are hidden while it
is inactive (see contracts.md).
Commands
ecommerce:satellite:uninstall {package}
# Deregister: run the uninstaller, stop wiring routes/config/bindings,
# clear cached config + routes. Tables and rows are preserved.
php artisan ecommerce:satellite:uninstall acme/ecommerce-subscriptions
# Same, and also roll back the satellite's migrations (drops its tables/columns).
php artisan ecommerce:satellite:uninstall acme/ecommerce-subscriptions --purge
Every lifecycle command first syncs the registered descriptors to
ecommerce_satellites. An unknown package fails with a pointer to
ecommerce:satellite:audit.
| Option | Purpose |
|---|---|
--purge |
Also roll back the satellite's migrations, dropping its tables and columns. |
--force |
Skip the confirmation prompt. Required in production and in non-interactive runs. |
The steps run in this order: validate the purge paths, confirm, run the
satellite's uninstaller (uninstall( $descriptor, $purge )), roll back the
migrations when purging, mark the satellite uninstalled, and clear the config
and route caches if they're cached.
- Prompts for confirmation unless
--forceis given. Non-interactive runs (-n, deploy scripts, CI) and production refuse without--force. - With
--purge, validates every migration path before anything runs and aborts the whole uninstall if one is shared with the app or the engine. - A satellite may only take product types out of the registry that it
actually provides: engine types (
simple,digital, …) and keys another active satellite also declares are left alone. - Works for a satellite that is still installed or one that only exists as a
row (e.g. after
composer remove). --purgerolls back every migration found in the satellite's storedmigration_paths, so the migration files must still be on disk: purge beforecomposer remove. Missing paths are skipped with a warning.- Running it again without
--purgeon an already-uninstalled satellite does nothing. Running it again with--purgepurges it.
Then remove the package: composer remove acme/ecommerce-subscriptions.
ecommerce:satellite:reinstall {package}
Clears the uninstalled mark and clears the config and route caches if they're
cached, so the satellite re-wires on the next boot. It then re-attaches to its
preserved data. A satellite that isn't uninstalled is left as it is. If it was
purged, run php artisan migrate first. The command takes no options.
ecommerce:satellite:audit
Lists every satellite the engine knows about (active, uninstalled, or
not-registered — its row exists but the package no longer boots) and the
orphaned schema they left behind: tables and columns declared by an
uninstalled or unregistered satellite that still exist and that no active
satellite claims. This catches a satellite replaced by a differently-named one.
php artisan ecommerce:satellite:audit
php artisan ecommerce:satellite:audit --json
php artisan ecommerce:satellite:audit --fail-on-orphans # exit 1 when anything is orphaned
| Option | Purpose |
|---|---|
--json |
Print { "satellites": [...], "orphans": [...] } instead of tables. |
--fail-on-orphans |
Exit non-zero when anything is orphaned. |
Each satellite row has package, version, status, and verified (whether a
verification hash is recorded). Each orphan row from
SatelliteOrphanAuditor has
package, reason (uninstalled or not-registered), kind (table or
column), table, and column (null for a table). A declared table or
column only counts when it still exists in the schema.
The audit is advisory: orphans are harmless (Eloquent ignores unknown columns), and reinstalling the satellite claims them again.
Missing product types
A product whose type is no longer registered (e.g. subscription after the
subscriptions satellite is uninstalled) resolves to the MissingProductType
placeholder:
- It stays queryable and listed — the REST/GraphQL product resource carries
type_missing: trueand (to admin callers only) a translatedtype_warningfor admin UIs to show as a banner. - It is read-only:
ProductPolicy::update()denies every user, andProduct::isEditable()returnsfalse. - It cannot be sold: adding it to a cart fails with a
422product-type-missingproblem, and pricing a line throws aCartOperationException. - Historical orders are untouched. When the satellite is reinstalled, its products become editable and sellable again.

