Modules Configuration
Module discovery and paths.
config/modules.php defines discovery paths and explicit modules.
Default configuration #
return [
'paths' => [
base_path('user/modules/*'),
base_path('../VelvetCMS-*'),
],
'tenant_paths' => [
base_path('user/tenants/{tenant}/modules/*'),
],
'modules' => [],
'auto_discover' => true,
];
Keys #
| Key | Description |
|---|---|
paths |
Glob patterns for module discovery |
tenant_paths |
Tenant-scoped module paths (uses {tenant} placeholder) |
modules |
Explicit module entries (name โ path) |
auto_discover |
Enable Composer package discovery (velvetcms-module type) |
Behavior #
pathsare scanned formodule.jsonmanifests (supports glob patterns).tenant_pathsare scanned only when tenancy is enabled. Use{tenant}as a placeholder for the resolved tenant id.modulesallows explicit, named module entries (path or manifest location).- Module discovery happens from config, filesystem paths, and Composer packages of type
velvetcms-module.
Example: explicit module #
'modules' => [
'docs' => '../VelvetCMS-Docs',
],