ZajModules Manager (admin)
Audience: Administrators. Use the ZajModules Manager to enable, disable, and install modules.
Where: Admin UI at/admin/zajmodsys(or ZajModules Manager in the admin menu).
What is ZajModules Manager?
The control room for all ZajModules:
- Discovers modules from the configured paths (e.g.
packages/ZajModSys/ZajModules). - Tracks each module’s state in the database (
zajmodsys_modules). - Lets you enable, disable, or uninstall modules from the UI or CLI.
- On first enable, runs the module’s migrations (if it has a database). On uninstall, runs cleanup or rollback.
Module states
| State | Meaning |
|---|---|
| Not installed | No row in zajmodsys_modules. First time you click Enable, a row is created and install runs (migrations, etc.). |
| Disabled | Row exists with status = disabled. Module code is not loaded; tables and data stay. You can enable again later. |
| Enabled | Row has status = enabled. The app loads the module’s routes, views, and providers on each request. |
Enable a module
- Open ZajModules Manager → module list (card or table view).
- Find the module and click Enable (or open Details and click Enable).
- What runs (in order):
- Dependency check – If the module’s
module.jsonlists other modules as dependencies, those must be enabled first. Otherwise you see: "Dependency 'X' must be enabled first". - First-time install (only if not yet installed) – Migrations (if the module has
database/migrationsorsrc/Database/Migrations), optional seeders, theninstallhook. If this fails, you see the error and the module is not enabled. - Mark enabled – Row in
zajmodsys_modulesis set tostatus = enabled. - Boot – Module’s
boot()runs and its service providers register (routes, views). - Clear cache – Discovery cache is cleared so the next request sees the new state.
- Dependency check – If the module’s
CLI (from project root):
php artisan zajmodsys:enable <slug>
Example: php artisan zajmodsys:enable Contract.
Disable a module
- In the manager, click Disable for that module.
- What runs:
- Dependents check – If any other enabled module lists this one as a dependency, disable is blocked. You see: "Cannot disable: 'X' depends on this module". Disable the dependent module first.
- Shutdown – Module’s
shutdown()is called (if implemented). - Mark disabled – Row is set to
status = disabled. No data is deleted; tables stay. - Clear cache – Same as enable.
CLI:
php artisan zajmodsys:disable <slug>
Uninstall a module
- Only when the module is disabled. If it’s enabled, the Uninstall button is hidden; disable it first.
- What runs:
- Uninstall hook –
$module->uninstall()(if lifecycle hooks are enabled). - Cleanup or rollback – If the module has
database/cleanuporsrc/Database/Cleanup, migrations in that folder run. Otherwisemigrate:rollbackis run for the module’s migrations folder. - Delete records – Row in
zajmodsys_modulesand any per-user access rows are removed. The module folder on disk is not deleted.
- Uninstall hook –
Destructive: Module data and tables are removed. Code files remain.
Bulk actions (table view)
- Select one or more modules with the checkboxes.
- Use Enable Selected or Disable Selected.
- Each module is processed in turn; if one fails (e.g. dependency), you see that error; others may still succeed.
Clear cache
- When: After you add or move module folders (e.g. after Install from ZIP or editing files).
- What: Rescans the configured paths and rebuilds the module list; cache key
zajmodsys:allis cleared. No database or module state is changed. - How: Click Clear Cache in the manager, or run:
php artisan zajmodsys:clear-cache
Install from ZIP
When Install from ZIP is enabled in config:
- Go to ZajModules Manager → Install from ZIP (or
/admin/zajmodsys/upload). - ZIP file – Must contain one top-level folder (e.g.
MyModule) with a validmodule.json(at least"name") and the module files inside. - Tier – Choose System, AdminOnly, or Addons.
- Category – Enter a category name (e.g.
Tools,Marketing). - Click Upload and Install. The module is extracted to
{modules_path}/{Tier}/{Category}/{FolderName}, cache is cleared, and you are redirected to the list. Enable the new module from the list if you want it active.
Limits: Max ZIP size is set in config (zajmodsys.features.zip_upload_max_mb, default 10 MB).
CLI commands (reference)
| Command | Purpose |
|---|---|
php artisan zajmodsys:list |
List all discovered modules |
php artisan zajmodsys:enable <slug> |
Enable a module |
php artisan zajmodsys:disable <slug> |
Disable a module |
php artisan zajmodsys:status [slug] |
Show status (optionally for one module) |
php artisan zajmodsys:clear-cache |
Clear discovery cache |
php artisan zajmodsys:migrate <slug> |
Run migrations for a module |
Troubleshooting
| Issue | What to do |
|---|---|
| Module not in list | Click Clear cache or run php artisan zajmodsys:clear-cache. We rescan paths; new or moved folders will appear. |
| Enable fails | Check the message. Often a dependency must be enabled first. Enable that module, then this one. |
| Uninstall button missing | Disable the module first. Uninstall is only shown when the module is disabled. |
See also
- In-app help – Use the Help button (floating) on the manager pages for the same content in short form.
- Technical docs –
packages/ZajModSys/_Docs/04-Manager-Usage.md,08-Help-System-Checklist.md,06-Full-Audit-CLI-Browser.md.