Download the PHP package dem1-off/laravel-modular without Composer
On this page you can find all versions of the php package dem1-off/laravel-modular. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-modular
dem1-off/laravel-modular
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
- 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, routes, translations and artisan commands load by convention, so the common provider is empty. - Checkable boundaries — declare inter-module dependencies with
requiresinmodule.json(dependency-aware load order) and letmodule:check --boundariesfail CI when a module reaches into another module's internals instead of its contracts. - Fast by design —
module:cachecompiles discovery, attributes and each module's resolved folders into one PHP file (zero reflection, zero filesystem scanning, zero stat calls per module at runtime), wired intophp 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, andmodule_path()conventions, so existing projects interoperate.
A module at a glance
Installation
config/modules.php uses conventional module config keys (namespace,
paths, statuses_file), so an existing modular project migrates without
editing modules.
Creating a module
Produces a promotion-ready package:
Prefer to start with nothing? --layout=clean scaffolds a namespace and a
provider, and nothing else — every convention folder is opt-in, and one you
never add costs nothing at boot:
Presets: ddd (default), simple, contracts, clean.
Configuring a module
Convention loads, attributes wire. Config, migrations, views, routes,
translations and artisan commands (from Console/ directories) load
automatically when their folders exist. Declare container bindings and
listeners with attributes:
Need more than attributes? Override register()/boot() and call the parent —
it's a normal Laravel provider. See the
docs.
Performance
Attributes reflect in development. In production, php artisan module:cache
compiles discovery, attributes and each module's resolved convention folders
into one PHP file — a request does zero reflection, zero filesystem scanning and
no stat calls per module. It's wired into php artisan optimize, and the usual
cached-artifact rule applies: add a routes/ or lang/ folder to a module and
rebuild the cache for it to take effect.
Runtime API
Customising behaviour
A module provider is a normal Laravel ServiceProvider. For anything beyond
attributes, override register()/boot() and call the parent:
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
Because a module is already a Composer package and its namespace
(Modules\Blog\) never changes, promotion is mechanical:
-
Move the directory to its own git repo
-
Point the app at it via Composer — swap the path entry for a VCS/version constraint in the root
composer.json: 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": trueso in-app modules and promoted packages behave identically during development.
License
MIT.
All versions of laravel-modular with dependencies
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/filesystem Version ^11.0|^12.0|^13.0