opscale-co / strict-rules
Opinionated Opscale rules for enforcing software architecture guidelines
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:phpstan-extension
Requires
- php: ^8.2
- nunomaduro/larastan: ^3.4
Requires (Dev)
- driftingly/rector-laravel: ^2.0
- laravel/laravel: ^11
- laravel/nova: ^5.7
- lorisleiva/laravel-actions: ^2.9
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpunit: ^11.5
- rector/rector: ^2.0
- tightenco/duster: ^3.2
This package is auto-updated.
Last update: 2025-06-25 15:07:38 UTC
README
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 or sharing your thoughts on social media. Your feedback helps us improve and grow!
📧 Send us feedback on what we can improve at feedback@opscale.co. 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 hire@opscale.co to discuss your project needs.
Thanks for helping Opscale continue to scale! 🚀
Description
Enforce software architecture guidelines for your Laravel projects with opinionated, battle-tested rules that promote maintainable, scalable code.
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.
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.
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.
Supported Guidelines
Guideline | Purpose | Key Concepts | Documentation |
---|---|---|---|
DDD | Domain modeling with Laravel pragmatism | Aggregates, Entities, Value Objects, Repositories, Domain Services | DDD Assumptions |
Clean Architecture | Layered separation of concerns | Representation, Communication, Transformation, Orchestration, Interaction | Clean Assumptions |
SOLID | Code smell prevention through proven principles | SRP, OCP, LSP, ISP, DIP with practical Laravel application | SOLID Assumptions |
Installation
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
You can run the command vendor/bin/phpstan analyze to execute the rules.
Testing
npm run test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email development@opscale.co instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.