Commands

osdd:list

List the layers with their providers, requirements, file counts and health.

osdd:list shows every discovered layer: where it lives, what it contains, what it requires, and whether it is wired correctly.

php artisan osdd:list
  functional/orders ............................................ functional/orders
  Namespace ............................................................ Functional\Orders\
  Providers ......................... Functional\Orders\Providers\OrdersServiceProvider
  Requires .............................................................. functional/users
  Models ........................................................................... 3
  Migrations ....................................................................... 4
  Seeders .......................................................................... 1
  Tests ........................................................................... 12
  Route files ...................................................................... 2
  Health ............................................... no test suite in phpunit.xml

  INFO  1 layer listed.

The command never changes anything and always exits with 0. Layers are sorted by name.

Options

OptionDescription
--jsonPrint the layers as JSON, for scripts and coding agents.

JSON output

php artisan osdd:list --json
{
    "layers": [
        {
            "name": "functional/orders",
            "path": "functional/orders",
            "namespace": "Functional\\Orders\\",
            "providers": ["Functional\\Orders\\Providers\\OrdersServiceProvider"],
            "requires": ["functional/users"],
            "counts": {"models": 3, "migrations": 4, "seeders": 1, "tests": 12, "route_files": 2},
            "health": {
                "required": true,
                "path_repository": true,
                "installed": true,
                "provider_extends_layer_service_provider": true,
                "test_suite": false
            }
        }
    ],
    "invalid_manifests": [
        {"file": "functional/billing/composer.json", "error": "it has no \"name\"."}
    ]
}
KeyContent
pathLayer folder, relative to the project
namespaceRoot namespace of the layer
providersThe extra.laravel.providers of the layer
requiresThe discovered layers in its require; other packages are left out
counts.models.php files under the Models folder of the source directory
counts.migrationsdatabase/migrations/*.php files, sub-folders not included
counts.seeders.php files under database/seeders
counts.tests*Test.php files under tests/
counts.route_filesroutes/*.php files
invalid_manifestsLayer composer.json files OSDD could not read, relative to the project, with the reason

With no layer, the output is {"layers": [], "invalid_manifests": []}.

Health

Each flag tells what to fix when it is false:

The text output shows the problems in the Health row: not required in composer.json, no path repository, not installed, provider does not extend LayerServiceProvider, no test suite in phpunit.xml, or OK.

FlagFix
requiredAdd "vendor/package": "*" to the require of the root composer.json
path_repositoryAdd a path repository covering the layer to the root composer.json
installedRun composer update vendor/package
provider_extends_layer_service_providerDeclare a provider in extra.laravel.providers that extends Lomkit\Osdd\LayerServiceProvider and is autoloadable. null while the layer is not installed: fix installed first.
test_suiteRun osdd:phpunit

Invalid composer.json files

A layer composer.json that cannot be read is listed with its error, marked INVALID, and the command keeps listing the valid layers:

  functional/billing/composer.json ............................................. INVALID
  Error ................................................................. it has no "name".

  INFO  1 layer listed.

  WARN  1 invalid layer manifest skipped.

See Invalid composer.json files for what makes a file invalid.

A folder you expect is missing? Its composer.json lacks "type": "layer", is invalid, the folder is not under a path of osdd.layers.paths, or a stale layer cache hides it: run php artisan osdd:clear.