jonpurvis/lawman
Lawman adds automatic validation to Laravel Eloquent models. Define validation rules directly on a model and have them enforced before saving, helping keep model data consistent without repeating validation logic across your app.
Package context: Lawman (jonpurvis/lawman) is a Laravel package that introspects an application's codebase and emits Mermaid.js architecture diagrams. It is a developer-tooling / documentation package, not a runtime dependency, which frames the entire risk profile: blast radius is limited to developer workflow and CI, not production traffic.
Architecture fit: Strong fit as a dev-only dependency (require-dev). It consumes the app's own source tree statically and produces a text artifact (Mermaid) that diffs cleanly in Git, which aligns well with docs-as-code and PR-review workflows. It does not sit in the request path, so it imposes no latency, memory, or autoload cost on production. The main architectural question is whether its output is trustworthy enough to be treated as a source of truth for architecture reviews, or only as a hint — static analysis of Laravel's convention-driven, dynamically-resolved code (container bindings, string-based model relationships, route definitions) is inherently approximate.
Integration feasibility (v5.2.0): High. This is a minor release with two changes:
No breaking changes, no deprecations, no config or command signature changes are advertised. Treat as adopt-with-a-glance rather than adopt-blindly, because the release notes are one line per change and do not enumerate the new helpers or their intended use.
Technical risk: Low overall.
composer.json if diagrams are CI-gated, so an unreviewed patch cannot alter output and break a build.Key questions for the maintainer / internal owners:
Stack fit: Native to Laravel via package auto-discovery; invoked through an Artisan command and published config. Output is plain Mermaid, renderable in GitHub/GitLab markdown, Confluence, Notion, or a docs site (Docusaurus/MkDocs with Mermaid plugin). This makes it compatible with essentially any documentation surface the team already uses — no new rendering infrastructure required.
Migration path: Greenfield addition, so no migration. The only "migration" is organisational: moving from hand-drawn or nonexistent architecture diagrams to generated ones. Sequence it so the generated artifact supplements rather than replaces curated diagrams (C4 context diagrams, ADRs) that capture intent the code cannot express.
Compatibility: Install as a dev dependency and verify against the team's actual Laravel/PHP matrix before rollout. Because it is require-dev, it cannot leak into production builds or transitive consumer installs — confirm this by checking that the lockfile diff touches only packages-dev and that CI's production install uses --no-dev.
Sequencing:
5.2.0 exactly in one representative application (largest/most conventional Laravel service). Run generation, commit the output, and diff it against the team's mental model of the architecture. This is the real acceptance test — accuracy, not installation, is the gate.Note that 5.1.0 → 5.2.0 needs no upgrade ceremony; if another service is already on 5.1.x, bump it in the same PR as the drift check to keep tooling versions uniform across repos.
Maintenance: Minimal and bounded. Dev-only dependency, no scheduled jobs, no data stores, no secrets, no network calls assumed. The recurring cost is regenerating diagrams when code changes — which is precisely the value, provided it is automated. Manual regeneration is the most likely failure mode of the whole initiative: it will be done diligently for three weeks and then not at all.
Support: Community-supported, single maintainer. No vendor SLA. Mitigations: pin the version, vendor or fork if diagrams become load-bearing for compliance or audit documentation, and keep the generated output in Git so the artifacts survive the package becoming unmaintained. The Mermaid output is portable — if the tool is abandoned, existing diagrams remain valid and only regeneration is lost.
Scaling: Scales well in the near term. Two ceilings to watch: (a) diagram legibility degrades superlinearly with application size — a large monolith becomes an unreadable hairball, so scope diagrams per module/domain; (b) CI cost is one extra job per repo per PR, negligible if scoped to changed paths or run on merge to main rather than on every push.
Failure modes and mitigations:
Ramp-up: Low — roughly half a day for an engineer to install, run, tune config, and understand the output; under an hour for a reviewer to read a Mermaid diagram in a PR. The larger organisational ramp-up is cultural: getting reviewers to actually consult the diagram during design discussions rather than treating it as a one-off deliverable.
TPM verdict: Adopt v5.2.0. Low-risk, additive minor release on a low-blast-radius dev tool; the decision hinges on output accuracy and automation, not on the release contents. Gate full rollout on a one-repo accuracy pilot and a non-blocking drift check, and confirm the new helpers do not churn committed diagrams.
How can I help you explore Laravel packages today?