Expose the modules on the actuator
At the end, GET /actuator/modules returns every module (enabled and disabled) as JSON. External tools and dashboards can inspect module status over HTTP without shell access.
When nwidart/laravel-actuator ^1.1 is installed, Laravel Modules registers the modules endpoint automatically. Earlier versions (1.0.0) do not support custom endpoints and return 404.
Expose the endpoint
Section titled “Expose the endpoint”-
Install the actuator.
Terminal window composer require nwidart/laravel-actuator -
Publish its configuration.
Terminal window php artisan vendor:publish --tag=actuator-config -
Add
modulestoexposure.includeinconfig/actuator.php.config/actuator.php 'exposure' => ['include' => ['health', 'modules'],'exclude' => [],],By default, the actuator exposes
healthonly. Settingincludeto['*']exposesmodulesalongside all other actuator endpoints, andexcludealways wins.modules.actuator.enabledinconfig/modules.phpdoes not control this endpoint. It controls health indicators only; see Report module health with the actuator.
Read the modules
Section titled “Read the modules”curl -H 'Accept: application/json' http://127.0.0.1:8000/actuator/modulesThe response includes the installed package version and every module sorted case-insensitively by name:
{ "package": { "name": "nwidart/laravel-modules", "version": "v13.3.0" }, "modules": [ { "name": "Blog", "enabled": true, "version": "1.2.0", "description": "Blog posts", "priority": 0, "providers": ["Modules\\Blog\\Providers\\BlogServiceProvider"] }, { "name": "Shop", "enabled": false, "version": null, "description": "", "priority": 10, "providers": ["Modules\\Shop\\Providers\\ShopServiceProvider"] } ]}Each module exposes only name, enabled, version, description, priority, and providers. It never exposes filesystem paths, files, custom module.json keys, composer.json, or package configuration. See Actuator integration for the exact schema and defaults.
Read one module
Section titled “Read one module”curl -H 'Accept: application/json' http://127.0.0.1:8000/actuator/modules/shop{ "name": "Shop", "enabled": false, "version": null, "description": "", "priority": 10, "providers": ["Modules\\Shop\\Providers\\ShopServiceProvider"] }Name lookup matches Module::find() (case-insensitive, accepting kebab-case or snake_case). An unknown module returns 404. The endpoint is read-only.
Protect the endpoint
Section titled “Protect the endpoint”actuator.middleware applies to every actuator route. To protect only the modules endpoint, add a modules.middleware block to config/actuator.php:
'modules' => [ 'middleware' => ['auth.basic'],],With auth.basic, /actuator/modules returns 401 without credentials while /actuator/health stays public.
Caching
Section titled “Caching”The endpoint works with php artisan config:cache and php artisan route:cache. Status changes appear on the next request with no cache to clear.
Check the result
Section titled “Check the result”php artisan route:list --path=actuatorThe output lists actuator/modules and actuator/modules/{name}. If they are missing, verify modules is in exposure.include and nwidart/laravel-actuator is 1.1.0 or later.