PHPackages                             opscale-co/strict-rules - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. opscale-co/strict-rules

ActivePhpstan-extension[Utility &amp; Helpers](/categories/utility)

opscale-co/strict-rules
=======================

Opinionated Opscale rules for enforcing software architecture guidelines

1.1.3(8mo ago)0715MITPHPPHP ^8.2CI passing

Since Jun 18Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/opscale-co/strict-rules)[ Packagist](https://packagist.org/packages/opscale-co/strict-rules)[ RSS](/packages/opscale-co-strict-rules/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (9)Versions (7)Used By (5)

Support us
----------

[](#support-us)

Support Opscale

At Opscale, we’re passionate about contributing to the open-source community by providing solutions that help businesses scale efficiently. If you’ve found our tools helpful, here are a few ways you can show your support:

⭐ **Star this repository** to help others discover our work and be part of our growing community. Every star makes a difference!

💬 **Share your experience** by leaving a review on [Trustpilot](https://www.trustpilot.com/review/opscale.co) or sharing your thoughts on social media. Your feedback helps us improve and grow!

📧 **Send us feedback** on what we can improve at . We value your input to make our tools even better for everyone.

🙏 **Get involved** by actively contributing to our open-source repositories. Your participation benefits the entire community and helps push the boundaries of what’s possible.

💼 **Hire us** if you need custom dashboards, admin panels, internal tools or MVPs tailored to your business. With our expertise, we can help you systematize operations or enhance your existing product. Contact us at  to discuss your project needs.

Thanks for helping Opscale continue to scale! 🚀

Description
-----------

[](#description)

Enforce software architecture guidelines for your Laravel projects with opinionated, battle-tested rules that promote maintainable, scalable code.

### Why Use Architectural Guidelines?

[](#why-use-architectural-guidelines)

Modern software projects face increasing complexity as they scale. Without clear architectural boundaries, codebases become tangled, difficult to test, and expensive to maintain. Our approach focuses on **preventing architectural debt** before it accumulates, ensuring your Laravel applications remain clean and extensible as they grow. Learn more about our architectural philosophy in [software-architecture.md](src/Rules/1-software-architecture.md).

### How We Design Software Components

[](#how-we-design-software-components)

We follow a **business-centric design methodology** that starts with understanding the domain before writing code. Our systematic approach guides you through identifying business units, mapping information flows, modeling data architecture, and defining business rules that create value. This methodology ensures your software components genuinely reflect how the business operates, making them both maintainable and AI-friendly. Discover our complete design process in [design-methodology.md](src/Rules/2-design-methodology.md).

### What Guidelines We Cover

[](#what-guidelines-we-cover)

Through **real-world examples and data stories**, we implement three proven architectural approaches that work together to create robust Laravel applications. Each guideline is illustrated with practical scenarios that demonstrate both common problems and their solutions. See concrete implementations in [data-story.md](src/Rules/3-data-story.md).

### Supported Guidelines

[](#supported-guidelines)

GuidelinePurposeKey ConceptsDocumentation**[DDD](src/Rules/DDD/assumptions.md)**Domain modeling with Laravel pragmatismAggregates, Entities, Value Objects, Repositories, Domain Services[DDD Assumptions](src/Rules/DDD/assumptions.md)**[Clean Architecture](src/Rules/CLEAN/assumptions.md)**Layered separation of concernsRepresentation, Communication, Transformation, Orchestration, Interaction[Clean Assumptions](src/Rules/CLEAN/assumptions.md)**[SOLID](src/Rules/SOLID/assumptions.md)**Code smell prevention through proven principlesSRP, OCP, LSP, ISP, DIP with practical Laravel application[SOLID Assumptions](src/Rules/SOLID/assumptions.md)Installation
------------

[](#installation)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f4ba25d9699e53a738cd4c85160a484d6682a062a4b432f48243e5c68457808e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f707363616c652d636f2f7374726963742d72756c65732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/opscale-co/strict-rules)

You can install the package in to a Laravel project via composer:

```
composer require opscale-co/strict-rules --dev
```

Next up, you must create a `phpstan.neon` file in the root of your project with this content:

```

includes:
    - vendor/nunomaduro/larastan/extension.neon
    - vendor/opscale-co/strict-rules/rules.clean.neon
    - vendor/opscale-co/strict-rules/rules.ddd.neon
    - vendor/opscale-co/strict-rules/rules.smells.neon
    - vendor/opscale-co/strict-rules/rules.solid.neon
parameters:
    level: 8
    phpVersion: 80200
    paths:
        - src

```

You are free to use only a subset of rules commenting the not needed guidelines.

Usage
-----

[](#usage)

You can run the command vendor/bin/phpstan analyze to execute the rules.

Testing
-------

[](#testing)

```
npm run test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/opscale-co/.github/blob/main/CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Opscale](https://github.com/opscale-co)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance62

Regular maintenance activity

Popularity10

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~23 days

Total

5

Last Release

242d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3722594?v=4)[opscale](/maintainers/opscale)[@opscale](https://github.com/opscale)

---

Top Contributors

[![opscale-development](https://avatars.githubusercontent.com/u/181295122?v=4)](https://github.com/opscale-development "opscale-development (64 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (6 commits)")[![semantic-release-bot](https://avatars.githubusercontent.com/u/32174276?v=4)](https://github.com/semantic-release-bot "semantic-release-bot (5 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisRector

### Embed Badge

![Health badge](/badges/opscale-co-strict-rules/health.svg)

```
[![Health](https://phpackages.com/badges/opscale-co-strict-rules/health.svg)](https://phpackages.com/packages/opscale-co-strict-rules)
```

###  Alternatives

[worksome/coding-style

Worksomes coding style

49771.7k57](/packages/worksome-coding-style)[lasselehtinen/laravel-conventions-checker

grumphp config to automatically check conventions for Laravel projects

2210.4k4](/packages/lasselehtinen-laravel-conventions-checker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
