- What is mortexa/laravel-arkitect used for?
- It is a dev-time testing utility that lets you express Laravel architecture rules in code, such as layer boundaries, naming conventions, and dependency constraints. You run it as part of your test suite so violations fail CI before they spread. It is intended for governance and developer experience rather than runtime application behavior.
- How do I install laravel-arkitect in a Laravel application?
- Install it as a development dependency with composer require --dev mortexa/laravel-arkitect. Laravel package auto-discovery should register the service provider, and you typically add a dedicated architecture test suite under tests/Architecture. You can then write rule assertions using PHPUnit or Pest and run them with your normal test command.
- Which Laravel and PHP versions does laravel-arkitect support?
- The package is aimed at modern Laravel applications, and the evaluation context targets Laravel 10, 11, and 12 on PHP 8.1 or newer. You should still verify the exact Composer constraints on Packagist against your current LTS and planned upgrade before adoption. Version support and the maintainer's support policy are key spike checks.
- Does laravel-arkitect work with Pest and PHPUnit?
- It is designed to fit into a PHPUnit or Pest test suite, usually in a dedicated architecture test directory. Before rolling it out broadly, validate compatibility with your PHPUnit 10 or 11 and Pest 2 or 3 versions. Also test it under ParaTest or any parallel test execution setup you use in CI.
- How is laravel-arkitect different from Pest's native arch() testing?
- Pest 2 and later ship native arch() architecture testing, so the main question is what Laravel-specific presets, rule DSL, or baselining laravel-arkitect adds beyond that. The package aims to make architectural rules expressive in Laravel applications, but the feature delta needs to be durable across Pest releases. Compare capability for capability before adding a third-party dependency.
- Can I adopt laravel-arkitect incrementally with baselining or suppression?
- Incremental adoption depends on whether the package supports baselining or rule suppression, which should be confirmed in the documentation during a spike. If those features are limited, run the architecture suite in report-only, non-blocking mode for a period before making it blocking on pull requests. This avoids a flag-day cleanup and surfaces false positives early.
- Does laravel-arkitect run well in CI and parallel test suites?
- Because it is a test-time utility, it runs wherever your PHPUnit or Pest suite runs, including GitHub Actions, GitLab CI, or Bitbucket Pipelines. You should benchmark runtime and memory on your largest service and verify behavior under parallel test execution. Rule evaluation cost matters if you want to run it on every pull request.
- Is laravel-arkitect safe to include in a production Laravel app?
- It should be installed with require --dev and used only in the test and CI layer, not in production runtime code paths. That keeps its blast radius limited and makes it cheap to remove if the trial does not work out. It does not replace static analysis or code review; it complements them with structural checks.
- What are the alternatives to laravel-arkitect?
- Alternatives include Pest's native arch() testing, PHPArkitect, Deptrac, PHPStan or Larastan custom rules, and manual code review conventions. Pest arch() is the closest native option for Laravel teams already using Pest, while Deptrac and PHPArkitect focus on dependency and layer rules. Choose based on the specific architectural invariants you need to enforce.
- Is laravel-arkitect actively maintained, and what happens if it is abandoned?
- It is a single-maintainer package with a small public user base, although it has a recent 2025 release and an MIT license. Abandonment risk is real, but because it is a dev-only tool, a fork-and-vendor contingency is relatively cheap. Confirm the maintainer's responsiveness and contribution process before committing shared architectural rules to it.