phpno1/architecture
A Laravel/PHP package for applying clean architecture principles in real projects. It provides conventions and tooling to organize code into clear layers, reduce coupling, and keep applications consistent, testable, and easier to maintain as they grow. Designed to make architecture decisions explici...
Read the compatibility matrix before you write any code. The last tagged release is from April 2018, which puts the package in the Laravel 5.5–5.8 / PHP 7.1–7.2 era. On Laravel 9+, PHP 8, or anything using the newer container and console APIs, assume breakage until proven otherwise. If you still want to evaluate it, do so in a throwaway Laravel 5.8 app first.
Minimal steps:
composer require phpno1/architecture in a scratch project pinned to a period-appropriate Laravel version.config/app.php under providers, and any facade aliases under aliases.php artisan vendor:publish --provider="Phpno1\Architecture\...ServiceProvider". This is where the package's opinions live — read every published config file before touching your app.php artisan list and filter for the package's namespace. The generators are the real documentation here; the names tell you what layers the author expects (make:repository, make:service, make:criteria, make:module, or similar).First use case: scaffold one trivial CRUD feature (e.g. Post) end-to-end through the generated layers, then trace a single request from controller → service → repository → model. If that trace feels natural, the architecture fits your team; if it feels like ceremony, stop there.
The package is a scaffolding and layering toolkit, not a runtime library. Expect it to provide base classes and generators around a Domain / Application / Infrastructure / Presentation split:
Repository contract in the domain layer, an Eloquent implementation in infrastructure, bound in a per-module service provider. Keep the binding in a dedicated provider per module so you can swap implementations in tests.Integration tips:
Illuminate\* imports out of your domain and application directories; do the mapping between Eloquent models and domain objects inside the repository implementation.app/ namespace and delete the dependency. You get the architecture without the version lock — for a 2018 package this is usually the better outcome.NOASSERTION. The repository has a license file Composer can't classify. Before commercial use, read it manually — if it's unclear or missing, get written clarification or don't ship it.Class not found after composer require almost always means this.php artisan config:clear. Stale cached config is the most common "the package is ignoring my settings" cause.app()->getBindings() or php artisan tinker) to confirm your repository interface points at the implementation you expect. Provider registration order matters — a later provider can rebind and silently win.bindings array in the published config. Overriding via config is far safer than editing vendor files.Verdict for day-to-day use: adopt the ideas (layered modules, repository contracts, generators for consistency) rather than the package. If you do install it, pin your PHP and Laravel versions, fork it into your VCS, and treat the source as your documentation.
How can I help you explore Laravel packages today?