Build Laravel apps with Layered Architecture.
Laravel OSDD brings Open Source Driven Development to Laravel. Organize your application into independent, composable layers — each a full Composer package with its own models, migrations, seeders, and service providers.
composer require xefi/laravel-osdd php artisan osdd:start
One command to restructure everything
Run php artisan osdd:start on a fresh Laravel project and OSDD automatically sets up your layered architecture — no manual wiring required.
Independent Layers
Each domain concern lives as its own Composer package inside functional/ or technical/. Layers are isolated, testable, and reusable across projects.
Composer-native
Layers are registered as Composer path repositories. Laravel auto-discovers their service providers — no manual bootstrapping needed.
Layer-aware Artisan Commands
Every standard make:* command has an osdd:* counterpart. Files land inside the correct layer, not a global app/ directory.
Cross-layer Seeding
Register seeders from any layer's service provider. php artisan osdd:seed runs all of them in one go.
Per-layer Test Suites
Run php artisan osdd:phpunit to auto-register each layer's test directory in phpunit.xml. Test layers individually with --testsuite.
Config Override System
Use overrideConfigFrom() in any layer to deep-merge config values over defaults — layer-level configuration always wins.
A clear architecture for every concern
OSDD separates your application into two top-level buckets, keeping business logic and infrastructure concerns cleanly apart.
functional/
Domain layers that represent business concerns — functional/users, functional/orders, functional/billing. Each owns its own models, migrations, and seeders.
technical/
Infrastructure layers shared across the application — auth adapters, event buses, queue configuration. Keeps cross-cutting concerns in one place.
Scalable by Design
Add new layers without touching existing ones. The architecture scales naturally from a small app to a large monorepo — no big-bang refactors required.