Commands

osdd:graph

Print the graph of the layers and the layers they require.

osdd:graph prints the require edges between layers, read from each layer's composer.json. Other packages and require-dev entries are left out. Nodes and edges are sorted by name.

php artisan osdd:graph

Options

OptionDescription
--formatmermaid (default), dot or json. An unknown format exits with 1.

Mermaid

graph LR
    functional_orders["functional/orders"]
    functional_users["functional/users"]
    technical_core["technical/core"]
    functional_orders --> functional_users
    functional_users --> technical_core

Save it next to your documentation, or paste it in a Markdown file that renders Mermaid, such as a GitHub README:

php artisan osdd:graph > docs/layers.mmd

DOT

php artisan osdd:graph --format=dot | dot -Tsvg > layers.svg
digraph layers {
    rankdir=LR;
    "functional/orders";
    "functional/users";
    "technical/core";
    "functional/orders" -> "functional/users";
    "functional/users" -> "technical/core";
}

Render it with Graphviz.

JSON

php artisan osdd:graph --format=json
{
    "nodes": ["functional/orders", "functional/users", "technical/core"],
    "edges": [
        {"from": "functional/orders", "to": "functional/users"},
        {"from": "functional/users", "to": "technical/core"}
    ]
}
osdd:graph shows what the layers declare. osdd:check checks that the code matches it.