Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Structarmed

Structarmed Laravel Package

boundwize/structarmed

StructArmed turns architecture decisions into executable checks for Laravel and PHP projects. Start from PSR, MVC, or DDD presets, define your layers and dependency rules in native PHP, then run structarmed analyse to catch violations before they spread.

View on GitHub
Deep Wiki
Context7

Configurable PHP architecture guards — define your layers and rules, then keep them enforced

Frequently asked questions about Structarmed
How do I install StructArmed in a Laravel project?
Install it as a dev dependency with composer require --dev boundwize/structarmed. Then run vendor/bin/structarmed init --preset=psr4 to create a config, and vendor/bin/structarmed analyse to check your code. It is a CLI tool, so there is no service provider or runtime setup in Laravel.
Does StructArmed work with Laravel, or is it only for generic PHP projects?
StructArmed is designed for Laravel and PHP projects but is architecture-neutral: it is a dev-only static analysis CLI with no service provider, container bindings, or request-path footprint. It can be adopted in a Laravel monolith, modular monolith, or package-heavy app without touching Composer autoload or bootstrap. The exact PHP version floor and oldest supported Laravel version are not stated in the provided overview, so confirm them in composer.json and the docs before pinning it in CI.
What are the PSR, MVC, and DDD presets in StructArmed?
StructArmed ships built-in presets for PSR, MVC, and DDD projects. They let you start quickly with common layer and dependency conventions, then tune or extend the rules in native PHP. The quick start uses init --preset=psr4.
How do I define custom layers and dependency rules in StructArmed?
Configuration is plain native PHP that returns a fluent Architecture::define() object. You define layers and directional dependency rules, and you can compute, loop over, or share layer definitions across teams. There is no custom DSL to learn.
Can I run StructArmed in CI and what report formats does it support?
Yes. Add the dev dependency, initialize a preset, and run vendor/bin/structarmed analyse as a CI step; it supports Windows, macOS, and Linux. The overview mentions clear, actionable violation reports but does not enumerate console, JSON, SARIF, or JUnit output, so check the docs before relying on GitHub PR annotations.
Does StructArmed support baselines or ignoring existing violations?
The provided material does not confirm baseline or ignore-file support, and it explicitly lists ratcheting a violation budget as a question to resolve. It does note that YAGNI rules are scoped to scanned paths only, so extension points intended for external consumers may need skip strategies. Verify the current docs and changelog for your pinned version before assuming baseline behavior.
How does StructArmed handle Laravel facades, the container, and ::class string references?
The overview flags container resolution, app(), facades, ::class strings in config arrays, and event/listener discovery as known Laravel blind spots for string-based analysis. Those patterns can cause false positives or false negatives. Ask for documented skip strategies and test them on your codebase before enforcing rules broadly.
How does StructArmed compare to PHPStan, Deptrac, or PHPArkitect?
StructArmed focuses on dependency direction and abstraction hygiene, while PHPStan/Larastan handles types and correctness, Pint handles style, and Pest/PHPUnit handles behavior. Deptrac and PHPArkitect overlap with StructArmed, so running both creates two sources of truth for the same architecture policy. Choose one owner for dependency rules, or define a clear split.
Does StructArmed have an automatic fix mode?
Yes, the package has --fix support, including for YAGNI rules, which can lower adoption cost on a legacy codebase. That lets you converge on rules instead of freezing them at what currently passes. Review automated fixes like any other code change before committing them.
Is StructArmed production-ready and what are the maintenance risks?
Treat it as pre-1.0: the package is at 0.19.x with high release frequency and schema-affecting changes across minors, including new marker interfaces and preset semantics. The bus factor is one, there is no vendor or paid support, and adoption signals are thin at about 60 stars and zero dependents. Pin exact versions, review upgrades as changes, and expect to be an early adopter finding rough edges.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route