inengine / modulus
Modulus — module runtime for InEngine (enable/disable, discovery, lifecycle, doctor)
Fund package maintenance!
Requires
- php: ^8.5
- composer/semver: ^3.4
- illuminate/contracts: ^12.0||^13.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^11.0.0||^10.0.0||^9.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- pestphp/pest-plugin-profanity: *
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-20 22:22:31 UTC
README
Modulus is the module runtime for Laravel: it discovers Composer packages, tracks which ones are enabled or disabled in a file-backed store, filters Laravel package discovery so disabled modules never load providers, and runs lifecycle work (migrate, publish assets, seed, upgrade, doctor) through a CLI/API-first surface.
Feature modules register with Modulus when it is present and stay disabled until enabled. Without Modulus they boot as normal Spatie-style packages. Operator UI is optional and must call the same PHP API — it does not live in this package.
Requirements
- PHP ^8.5
- Laravel ^12 or ^13 (
illuminate/contracts^12 || ^13)
Installation
composer require inengine/modulus:^0.1@beta
php artisan vendor:publish --tag="modulus-config"
No migrations for the registry — state defaults to a JSON file under storage/modulus/ (typically gitignored content).
InEngine Core: Modulus is required automatically. InEngine Core already lists
inengine/modulusincomposer.jsonand installs the early-boot hook. You do not need a separatecomposer requirewhen starting from Core.
Beta: ^0.1@beta. Stable ^0.1 after the first non-beta tag. Monorepo develop: Core composer.local.json path *@dev.
Using Modulus in a Laravel app (not InEngine Core)
Any Laravel 12/13 app can host Modulus. Core is optional.
- Require and publish (see Installation above).
- Early boot (required). Laravel registers discovered providers before package providers boot. After
Application::configure(...)->create(), install the filtered manifest so enable/disable can gate discovery in time:
// bootstrap/app.php use Illuminate\Foundation\Application; use Illuminate\Foundation\Configuration\Exceptions; use Illuminate\Foundation\Configuration\Middleware; use InEngine\Modulus\Discovery\PackageManifestInstaller; $app = Application::configure(basePath: dirname(__DIR__)) ->withRouting( web: __DIR__.'/../routes/web.php', commands: __DIR__.'/../routes/console.php', health: '/up', ) ->withMiddleware(function (Middleware $middleware): void { // }) ->withExceptions(function (Exceptions $exceptions): void { // })->create(); if (class_exists(PackageManifestInstaller::class)) { PackageManifestInstaller::install($app); } return $app;
- Install ≠ enable ≠ seed
| Step | What happens |
|---|---|
composer require |
Code on disk only |
Modulus::publish() / modulus:publish |
Config + resources/dist → public/vendor/{name} |
modulus:enable |
Deps → lifecycle → migrate → discovery sync. No publish/seed |
Modulus::seed(..., confirmed: true) |
Explicit only; never on enable |
-
Feature modules should extend
InEngine\Modulus\ModuleServiceProvider, declaremodulusPackageName(), and ship providers only inextra.laravel.providers. Create them from InEngine/Skeleton (GitHub template, not Packagist). -
Prefer
Modulus::…/modulus:*over editingstorage/modulus/modules.jsonby hand.
Optional Composer I/O (require/remove/update from Artisan) is Modulus Composer — opt-in; do not hard-require it unless the host needs that surface.
Commands
php artisan modulus:list
php artisan modulus:discover
php artisan modulus:enable {package}
php artisan modulus:disable {package}
php artisan modulus:uninstall {package} # non-destructive of DB; forget state
php artisan modulus:status {package}
php artisan modulus:publish {package}
php artisan modulus:seed {package} # prompts / requires confirmation
php artisan modulus:upgrade {package?} {--publish} {--approve=}
php artisan modulus:outdated
php artisan modulus:update {--auto} # --auto needs Modulus Composer applier + auto_patch
php artisan modulus:doctor
Default host constraint policy: patch → ~x.y.z. Minor/major bumps need approval via Modulus Composer (modulus-composer:approve) or UI later.
Extensions
| Package | Display name | Role |
|---|---|---|
inengine/modulus-composer |
Modulus Composer | Composer require/remove/update/approve, constraint rewrite, ModuleUpdateApplier (public MIT; opt-in) |
inengine/modulus-marketplace |
(planned) | Browse / install sources |
inengine/modulus-ui |
(planned) | Operator UI — private Pro |
inengine/modulus-inspect |
(deferred) | Optional UX over in-core Capability Registry |
Testing
composer test
composer analyse
composer format
Further documentation
- docs/ — user-facing documentation
- DESIGN.md — package design notes
- INTEGRATION.md — events, contracts, DTOs
- CHANGELOG.md
- InEngine Core — opinionated host that requires Modulus
- InEngine/Skeleton — feature-module GitHub template
Credits
- James Johnson
- Laravel — underlying application framework hosts integrate with
- Spatie — package tools / skeleton patterns used by feature modules
License
The MIT License (MIT). See LICENSE.txt.