PHPackages                             dem1-off/laravel-modular - 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. [Framework](/categories/framework)
4. /
5. dem1-off/laravel-modular

ActiveLibrary[Framework](/categories/framework)

dem1-off/laravel-modular
========================

Modular architecture tools for Laravel — DDD modules that promote to standalone packages with zero code churn

1.1.0(today)00MITPHPPHP ^8.3CI passing

Since Jun 20Pushed todayCompare

[ Source](https://github.com/DeM1-off/laravel-modular)[ Packagist](https://packagist.org/packages/dem1-off/laravel-modular)[ RSS](/packages/dem1-off-laravel-modular/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

dem1-off/laravel-modular
========================

[](#dem1-offlaravel-modular)

[![Latest Version on Packagist](https://camo.githubusercontent.com/85fe18c8caad2df68054b3d93bf0cf1043881b246084d886b2390f008d0df533/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64656d312d6f66662f6c61726176656c2d6d6f64756c61722e737667)](https://packagist.org/packages/dem1-off/laravel-modular)[![Total Downloads](https://camo.githubusercontent.com/fbf27534f17b4c9da54ab39f14fb1be8064562e05f03c10c2383245795fdbe04/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64656d312d6f66662f6c61726176656c2d6d6f64756c61722e737667)](https://packagist.org/packages/dem1-off/laravel-modular)[![PHP Version](https://camo.githubusercontent.com/5fc230136cdaa3b2f7e27c0001263f4d79b608d709fe25ffa8daf26bab8c2fc3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f64656d312d6f66662f6c61726176656c2d6d6f64756c61722e737667)](https://packagist.org/packages/dem1-off/laravel-modular)[![License](https://camo.githubusercontent.com/0869d66a6288cd0aba4b5de15873d563ead1f35aea0957ff9611b4c6a0fa4e75/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f64656d312d6f66662f6c61726176656c2d6d6f64756c61722e737667)](LICENSE)

Modular architecture tooling for Laravel. DDD modules (Domain / Application / Infrastructure) that are **real Composer packages from day one**, so any module can be promoted to a standalone package with zero code churn.

Highlights
----------

[](#highlights)

- **Attribute-driven wiring** — declare bindings and listeners with `#[Bind]`and `#[Listen]`, or let an implementation auto-bind itself with `#[Provides]`(Symfony-style autoconfigure for Laravel modules). Config, migrations, views and routes load by convention, so the common provider is empty.
- **Fast by design** — `module:cache` compiles discovery and attributes into one PHP file (zero reflection, zero filesystem scanning at runtime), wired into `php artisan optimize`.
- **A designed-in promotion path** — module namespaces never change, so moving a module into its own repo is a Composer change, not a refactor.
- **Familiar layout** — works with the `Modules/` directory, `module.json`, `modules_statuses.json`, and `module_path()` conventions, so existing projects interoperate.

A module at a glance
--------------------

[](#a-module-at-a-glance)

```
#[Bind(PostRepositoryInterface::class, EloquentPostRepository::class)]
#[Listen(ChapterPublished::class, SendDigest::class)]
final class BlogServiceProvider extends ModuleServiceProvider {}
```

Installation
------------

[](#installation)

```
composer require dem1-off/laravel-modular
php artisan vendor:publish --tag=modules-config
```

`config/modules.php` uses conventional module config keys (`namespace`, `paths`, `statuses_file`), so an existing modular project migrates without editing modules.

Creating a module
-----------------

[](#creating-a-module)

```
php artisan make:module Blog
```

Produces a promotion-ready package:

```
Modules/Blog/
├── composer.json          # type: laravel-module, PSR-4 Modules\Blog\
├── module.json            # module manifest
├── config/blog.php
├── database/{migrations,factories,seeders}/
├── resources/views/
├── src/{Domain,Application,Infrastructure}/
│   └── Infrastructure/Providers/BlogServiceProvider.php
└── tests/

```

Configuring a module
--------------------

[](#configuring-a-module)

**Convention loads, attributes wire.** Config, migrations, views and routes load automatically when their folders exist. Declare container bindings and listeners with attributes:

```
use Dem1Off\LaravelModular\Module\Attributes\Bind;
use Dem1Off\LaravelModular\Module\Attributes\Listen;
use Dem1Off\LaravelModular\Module\ModuleServiceProvider;

#[Bind(PostRepositoryInterface::class, EloquentPostRepository::class)]
#[Bind(FeedCache::class, RedisFeedCache::class, singleton: true)]
#[Listen(ChapterPublished::class, SendDigest::class)]
final class BlogServiceProvider extends ModuleServiceProvider {}
```

Need more than attributes? Override `register()`/`boot()` and call the parent — it's a normal Laravel provider. See the [docs](https://dem1-off.github.io/laravel-modular/basic-usage/attributes).

Performance
-----------

[](#performance)

Attributes reflect in development. In production, `php artisan module:cache`compiles discovery **and** attributes into one PHP file — a request does zero reflection and zero filesystem scanning. It's wired into `php artisan optimize`.

Runtime API
-----------

[](#runtime-api)

```
use Dem1Off\LaravelModular\Facades\Modules;

Modules::all();           // every module, keyed by name
Modules::enabled();       // only enabled ones
Modules::find('Blog');    // ModuleDescriptor|null
Modules::isEnabled('Blog');
Modules::path('Blog');    // absolute path

module_path('Blog', 'resources/views'); // path helper
```

Customising behaviour
---------------------

[](#customising-behaviour)

A module provider is a normal Laravel `ServiceProvider`. For anything beyond attributes, override `register()`/`boot()` and call the parent:

```
public function boot(): void
{
    parent::boot();

    Livewire::component('blog.feed', Feed::class);
}
```

Keep anything proprietary (navigation, mailing, metrics, …) in your application, invoked from the module's `boot()` — never inside this package.

Promoting a module to a standalone package
------------------------------------------

[](#promoting-a-module-to-a-standalone-package)

Because a module is already a Composer package and its namespace (`Modules\Blog\`) never changes, promotion is mechanical:

1. **Move the directory to its own git repo**

    ```
    git subtree split --prefix=Modules/Blog -b blog-module
    # push that branch to a new repo, or copy Modules/Blog out
    ```
2. **Point the app at it via Composer** — swap the path entry for a VCS/version constraint in the root `composer.json`:

    ```
    // before — local development
    "repositories": [{ "type": "path", "url": "Modules/*" }],
    "require": { "acme/blog-module": "*" }

    // after — promoted package
    "repositories": [{ "type": "vcs", "url": "git@github.com:acme/blog-module.git" }],
    "require": { "acme/blog-module": "^1.0" }
    ```
3. **`composer update acme/blog-module`** — done.

No namespace changes, no provider rewrites: Laravel package auto-discovery reads `extra.laravel.providers` from the module's own `composer.json`, exactly as it did in-app. Tests, static-analysis config, and the `module_path()` helper all keep working because the module's internal layout is unchanged.

> Tip: develop with `"type": "path"` + `"url": "Modules/*"` and `"symlink": true`so in-app modules and promoted packages behave identically during development.

License
-------

[](#license)

MIT.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/52733818?v=4)[Dmytro Dohryk](/maintainers/DeM1-off)[@DeM1-off](https://github.com/DeM1-off)

---

Top Contributors

[![DeM1-off](https://avatars.githubusercontent.com/u/52733818?v=4)](https://github.com/DeM1-off "DeM1-off (7 commits)")

---

Tags

laravellaravel-packagemoduleslaravelarchitecturemodulesdddmodular

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/dem1-off-laravel-modular/health.svg)

```
[![Health](https://phpackages.com/badges/dem1-off-laravel-modular/health.svg)](https://phpackages.com/packages/dem1-off-laravel-modular)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

9782.1M160](/packages/laravel-ai)[laravel/breeze

Minimal Laravel authentication scaffolding with Blade and Tailwind.

3.0k34.4M161](/packages/laravel-breeze)[laravel/sail

Docker files for running a basic Laravel application.

1.9k199.2M1.2k](/packages/laravel-sail)[laravel/wayfinder

Generate TypeScript representations of your Laravel actions and routes.

1.7k7.0M115](/packages/laravel-wayfinder)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76518.2M117](/packages/laravel-mcp)[laravel/folio

Page based routing for Laravel.

603526.4k31](/packages/laravel-folio)

PHPackages © 2026

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