Docs LATEST

Modules Configuration

Module discovery and paths.

Configuration

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 #

  • paths are scanned for module.json manifests (supports glob patterns).
  • tenant_paths are scanned only when tenancy is enabled. Use {tenant} as a placeholder for the resolved tenant id.
  • modules allows 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',
],